Skip to content

Commit f3c2a2b

Browse files
Make closures use stable symbol names.
1 parent 348c151 commit f3c2a2b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustc_trans/trans/closure.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
use arena::TypedArena;
12-
use back::link::{self, mangle_internal_name_by_path_and_seq};
12+
use back::{link, symbol_names};
1313
use llvm::{ValueRef, get_params};
1414
use middle::def_id::DefId;
1515
use middle::infer;
@@ -149,8 +149,9 @@ pub fn get_or_create_closure_declaration<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
149149
return llfn;
150150
}
151151

152-
let path = ccx.tcx().def_path(closure_id);
153-
let symbol = mangle_internal_name_by_path_and_seq(path, "closure");
152+
let symbol = symbol_names::exported_name(ccx,
153+
mono_id.def,
154+
mono_id.params.as_slice());
154155

155156
let function_type = ccx.tcx().mk_closure_from_closure_substs(closure_id, Box::new(substs));
156157
let llfn = declare::define_internal_rust_fn(ccx, &symbol[..], function_type);

0 commit comments

Comments
 (0)