diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2021-12-15 08:32:21 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2021-12-15 13:30:26 +1100 |
| commit | 8cddcd39ba2189da859a5164804556190906ee2a (patch) | |
| tree | 80c9ffaa12dad22abec107679298920b1f07509a /compiler/rustc_codegen_llvm/src | |
| parent | 22f8bde876f2fa9c5c4e95be1bce29cc271f2b51 (diff) | |
| download | rust-8cddcd39ba2189da859a5164804556190906ee2a.tar.gz rust-8cddcd39ba2189da859a5164804556190906ee2a.zip | |
Remove `SymbolStr`.
By changing `as_str()` to take `&self` instead of `self`, we can just return `&str`. We're still lying about lifetimes, but it's a smaller lie than before, where `SymbolStr` contained a (fake) `&'static str`!
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs index cc39332d198..7fdde653833 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs @@ -2087,8 +2087,8 @@ fn prepare_enum_metadata( let item_name; let discriminant_name = match enum_type.kind() { ty::Adt(..) => { - item_name = tcx.item_name(enum_def_id).as_str(); - &*item_name + item_name = tcx.item_name(enum_def_id); + item_name.as_str() } ty::Generator(..) => enum_name.as_str(), _ => bug!(), @@ -2563,7 +2563,8 @@ pub fn create_global_var_metadata(cx: &CodegenCx<'ll, '_>, def_id: DefId, global let is_local_to_unit = is_node_local_to_unit(cx, def_id); let variable_type = Instance::mono(cx.tcx, def_id).ty(cx.tcx, ty::ParamEnv::reveal_all()); let type_metadata = type_metadata(cx, variable_type, span); - let var_name = tcx.item_name(def_id).as_str(); + let var_name = tcx.item_name(def_id); + let var_name = var_name.as_str(); let linkage_name = mangled_name_of_instance(cx, Instance::mono(tcx, def_id)).name; // When empty, linkage_name field is omitted, // which is what we want for no_mangle statics |
