@@ -1037,7 +1037,7 @@ pub fn compile_unit_metadata<'ll, 'tcx>(
1037
1037
) -> & ' ll DIDescriptor {
1038
1038
let mut name_in_debuginfo = match tcx. sess . local_crate_source_file {
1039
1039
Some ( ref path) => path. clone ( ) ,
1040
- None => PathBuf :: from ( & * tcx. crate_name ( LOCAL_CRATE ) . as_str ( ) ) ,
1040
+ None => PathBuf :: from ( tcx. crate_name ( LOCAL_CRATE ) . as_str ( ) ) ,
1041
1041
} ;
1042
1042
1043
1043
// To avoid breaking split DWARF, we need to ensure that each codegen unit
@@ -1371,7 +1371,7 @@ fn closure_saved_names_of_captured_variables(tcx: TyCtxt<'_>, def_id: DefId) ->
1371
1371
_ => return None ,
1372
1372
} ;
1373
1373
let prefix = if is_ref { "_ref__" } else { "" } ;
1374
- Some ( prefix. to_owned ( ) + & var. name . as_str ( ) )
1374
+ Some ( prefix. to_owned ( ) + var. name . as_str ( ) )
1375
1375
} )
1376
1376
. collect :: < Vec < _ > > ( )
1377
1377
}
@@ -1949,7 +1949,7 @@ enum VariantInfo<'a, 'tcx> {
1949
1949
impl < ' tcx > VariantInfo < ' _ , ' tcx > {
1950
1950
fn map_struct_name < R > ( & self , f : impl FnOnce ( & str ) -> R ) -> R {
1951
1951
match self {
1952
- VariantInfo :: Adt ( variant) => f ( & variant. ident . as_str ( ) ) ,
1952
+ VariantInfo :: Adt ( variant) => f ( variant. ident . as_str ( ) ) ,
1953
1953
VariantInfo :: Generator { variant_index, .. } => {
1954
1954
f ( & GeneratorSubsts :: variant_name ( * variant_index) )
1955
1955
}
@@ -2114,8 +2114,8 @@ fn prepare_enum_metadata<'ll, 'tcx>(
2114
2114
let item_name;
2115
2115
let discriminant_name = match enum_type. kind ( ) {
2116
2116
ty:: Adt ( ..) => {
2117
- item_name = tcx. item_name ( enum_def_id) . as_str ( ) ;
2118
- & * item_name
2117
+ item_name = tcx. item_name ( enum_def_id) ;
2118
+ item_name. as_str ( )
2119
2119
}
2120
2120
ty:: Generator ( ..) => enum_name. as_str ( ) ,
2121
2121
_ => bug ! ( ) ,
@@ -2448,7 +2448,7 @@ fn compute_type_parameters<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, ty: Ty<'tcx>) -
2448
2448
cx. tcx . normalize_erasing_regions ( ParamEnv :: reveal_all ( ) , ty) ;
2449
2449
let actual_type_metadata =
2450
2450
type_metadata ( cx, actual_type, rustc_span:: DUMMY_SP ) ;
2451
- let name = & name. as_str ( ) ;
2451
+ let name = name. as_str ( ) ;
2452
2452
Some ( unsafe {
2453
2453
Some ( llvm:: LLVMRustDIBuilderCreateTemplateTypeParameter (
2454
2454
DIB ( cx) ,
@@ -2590,7 +2590,8 @@ pub fn create_global_var_metadata<'ll>(cx: &CodegenCx<'ll, '_>, def_id: DefId, g
2590
2590
let is_local_to_unit = is_node_local_to_unit ( cx, def_id) ;
2591
2591
let variable_type = Instance :: mono ( cx. tcx , def_id) . ty ( cx. tcx , ty:: ParamEnv :: reveal_all ( ) ) ;
2592
2592
let type_metadata = type_metadata ( cx, variable_type, span) ;
2593
- let var_name = tcx. item_name ( def_id) . as_str ( ) ;
2593
+ let var_name = tcx. item_name ( def_id) ;
2594
+ let var_name = var_name. as_str ( ) ;
2594
2595
let linkage_name = mangled_name_of_instance ( cx, Instance :: mono ( tcx, def_id) ) . name ;
2595
2596
// When empty, linkage_name field is omitted,
2596
2597
// which is what we want for no_mangle statics
0 commit comments