Skip to content

Commit

Permalink
minor rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Jul 24, 2015
1 parent d075faa commit 71d4418
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
4 changes: 1 addition & 3 deletions src/librustc_trans/trans/closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 2 additions & 6 deletions src/librustc_trans/trans/debuginfo/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/trans/debuginfo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 71d4418

Please sign in to comment.