minor rebase fixes
This commit is contained in:
parent
d075faa2ed
commit
71d44189e0
@ -148,9 +148,7 @@ pub fn get_or_create_closure_declaration<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
|
||||
});
|
||||
|
||||
let function_type = ccx.tcx().mk_closure_from_closure_substs(closure_id, Box::new(substs));
|
||||
let llfn = declare::define_internal_rust_fn(ccx, &symbol[..], function_type).unwrap_or_else(||{
|
||||
ccx.sess().bug(&format!("symbol `{}` already defined", symbol));
|
||||
});
|
||||
let llfn = declare::define_internal_rust_fn(ccx, &symbol[..], function_type);
|
||||
|
||||
// set an inline hint for all closures
|
||||
attributes::inline(llfn, attributes::InlineAttr::Hint);
|
||||
|
@ -811,14 +811,10 @@ pub fn type_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
||||
MetadataCreationResult::new(pointer_type_metadata(cx, t, fn_metadata), false)
|
||||
|
||||
}
|
||||
ty::TyClosure(def_id, ref substs) => {
|
||||
let infcx = infer::normalizing_infer_ctxt(cx.tcx(), &cx.tcx().tables);
|
||||
let upvars = infcx.closure_upvars(def_id, substs).unwrap();
|
||||
let upvar_types = upvars.iter().map(|u| u.ty).collect::<Vec<_>>();
|
||||
|
||||
ty::TyClosure(_, ref substs) => {
|
||||
prepare_tuple_metadata(cx,
|
||||
t,
|
||||
&upvar_types[..],
|
||||
&substs.upvar_tys,
|
||||
unique_type_id,
|
||||
usage_site_span).finalize(cx)
|
||||
}
|
||||
|
@ -416,7 +416,7 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
|
||||
ty::TyBareFn(_, ref barefnty) => {
|
||||
(cx.tcx().erase_late_bound_regions(&barefnty.sig), barefnty.abi)
|
||||
}
|
||||
ty::TyClosure(def_id, substs) => {
|
||||
ty::TyClosure(def_id, ref substs) => {
|
||||
let closure_type = cx.tcx().closure_type(def_id, substs);
|
||||
(cx.tcx().erase_late_bound_regions(&closure_type.sig), closure_type.abi)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user