about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2015-07-24 04:48:32 -0400
committerNiko Matsakis <niko@alum.mit.edu>2015-07-24 08:24:35 -0400
commit71d44189e04d714a64c304f00a7ebfd48150b93a (patch)
tree66b4adb18f539d5d8d8ca5063ce220b6542b3841 /src
parentd075faa2ed2a9290a4ac114ff6e0b87c03e86b98 (diff)
downloadrust-71d44189e04d714a64c304f00a7ebfd48150b93a.tar.gz
rust-71d44189e04d714a64c304f00a7ebfd48150b93a.zip
minor rebase fixes
Diffstat (limited to 'src')
-rw-r--r--src/librustc_trans/trans/closure.rs4
-rw-r--r--src/librustc_trans/trans/debuginfo/metadata.rs8
-rw-r--r--src/librustc_trans/trans/debuginfo/mod.rs2
3 files changed, 4 insertions, 10 deletions
diff --git a/src/librustc_trans/trans/closure.rs b/src/librustc_trans/trans/closure.rs
index ff89d97c47b..ef5da3e40df 100644
--- a/src/librustc_trans/trans/closure.rs
+++ b/src/librustc_trans/trans/closure.rs
@@ -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);
diff --git a/src/librustc_trans/trans/debuginfo/metadata.rs b/src/librustc_trans/trans/debuginfo/metadata.rs
index 66772e67755..09495dea286 100644
--- a/src/librustc_trans/trans/debuginfo/metadata.rs
+++ b/src/librustc_trans/trans/debuginfo/metadata.rs
@@ -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)
         }
diff --git a/src/librustc_trans/trans/debuginfo/mod.rs b/src/librustc_trans/trans/debuginfo/mod.rs
index 9ce5c457bff..8e4e0aaa75f 100644
--- a/src/librustc_trans/trans/debuginfo/mod.rs
+++ b/src/librustc_trans/trans/debuginfo/mod.rs
@@ -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)
             }