From 4beb9316410177b7d0e0dd3a40b437519131c786 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Sat, 30 Jun 2018 18:22:20 +0200 Subject: [PATCH] Use DefPathBasedNames --- src/base.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/base.rs b/src/base.rs index 27e3506ece3..8c19aba1404 100644 --- a/src/base.rs +++ b/src/base.rs @@ -14,7 +14,10 @@ pub fn trans_mono_item<'a, 'tcx: 'a>(cx: &mut CodegenCx<'a, 'tcx, CurrentBackend let func_id = { let module = &mut cx.module; *cx.def_id_fn_id_map.entry(inst).or_insert_with(|| { - module.declare_function(&tcx.absolute_item_path_str(def_id), Linkage::Local, &sig).unwrap() + let def_path_based_names = ::rustc_mir::monomorphize::item::DefPathBasedNames::new(tcx, false, false); + let mut name = String::new(); + def_path_based_names.push_instance_as_string(inst, &mut name); + module.declare_function(&name, Linkage::Local, &sig).unwrap() }) };