]> git.lizzy.rs Git - rust.git/commitdiff
Use DefPathBasedNames
authorbjorn3 <bjorn3@users.noreply.github.com>
Sat, 30 Jun 2018 16:22:20 +0000 (18:22 +0200)
committerbjorn3 <bjorn3@users.noreply.github.com>
Sat, 30 Jun 2018 16:22:20 +0000 (18:22 +0200)
src/base.rs

index 27e3506ece3bd06f8ea6d30878460a64cc5f63b3..8c19aba1404af317a363596aad8e282b4cb46f20 100644 (file)
@@ -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()
                     })
                 };