@@ -1039,7 +1039,7 @@ impl GenericBound {
1039
1039
fn maybe_sized ( cx : & DocContext < ' _ > ) -> GenericBound {
1040
1040
let did = cx. tcx . require_lang_item ( lang_items:: SizedTraitLangItem , None ) ;
1041
1041
let empty = cx. tcx . intern_substs ( & [ ] ) ;
1042
- let path = external_path ( cx, & cx. tcx . item_name ( did) . as_str ( ) ,
1042
+ let path = external_path ( cx, cx. tcx . item_name ( did) ,
1043
1043
Some ( did) , false , vec ! [ ] , empty) ;
1044
1044
inline:: record_extern_fqn ( cx, did, TypeKind :: Trait ) ;
1045
1045
GenericBound :: TraitBound ( PolyTrait {
@@ -1138,13 +1138,13 @@ fn external_generic_args(
1138
1138
1139
1139
// trait_did should be set to a trait's DefId if called on a TraitRef, in order to sugar
1140
1140
// from Fn<(A, B,), C> to Fn(A, B) -> C
1141
- fn external_path ( cx : & DocContext < ' _ > , name : & str , trait_did : Option < DefId > , has_self : bool ,
1141
+ fn external_path ( cx : & DocContext < ' _ > , name : Symbol , trait_did : Option < DefId > , has_self : bool ,
1142
1142
bindings : Vec < TypeBinding > , substs : SubstsRef < ' _ > ) -> Path {
1143
1143
Path {
1144
1144
global : false ,
1145
1145
res : Res :: Err ,
1146
1146
segments : vec ! [ PathSegment {
1147
- name: name. to_string( ) ,
1147
+ name: name. as_str ( ) . to_string( ) ,
1148
1148
args: external_generic_args( cx, trait_did, has_self, bindings, substs)
1149
1149
} ] ,
1150
1150
}
@@ -1154,7 +1154,7 @@ impl<'a, 'tcx> Clean<GenericBound> for (&'a ty::TraitRef<'tcx>, Vec<TypeBinding>
1154
1154
fn clean ( & self , cx : & DocContext < ' _ > ) -> GenericBound {
1155
1155
let ( trait_ref, ref bounds) = * self ;
1156
1156
inline:: record_extern_fqn ( cx, trait_ref. def_id , TypeKind :: Trait ) ;
1157
- let path = external_path ( cx, & cx. tcx . item_name ( trait_ref. def_id ) . as_str ( ) ,
1157
+ let path = external_path ( cx, cx. tcx . item_name ( trait_ref. def_id ) ,
1158
1158
Some ( trait_ref. def_id ) , true , bounds. clone ( ) , trait_ref. substs ) ;
1159
1159
1160
1160
debug ! ( "ty::TraitRef\n subst: {:?}\n " , trait_ref. substs) ;
@@ -3089,8 +3089,7 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
3089
3089
AdtKind :: Enum => TypeKind :: Enum ,
3090
3090
} ;
3091
3091
inline:: record_extern_fqn ( cx, did, kind) ;
3092
- let path = external_path ( cx, & cx. tcx . item_name ( did) . as_str ( ) ,
3093
- None , false , vec ! [ ] , substs) ;
3092
+ let path = external_path ( cx, cx. tcx . item_name ( did) , None , false , vec ! [ ] , substs) ;
3094
3093
ResolvedPath {
3095
3094
path,
3096
3095
param_names : None ,
@@ -3100,7 +3099,7 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
3100
3099
}
3101
3100
ty:: Foreign ( did) => {
3102
3101
inline:: record_extern_fqn ( cx, did, TypeKind :: Foreign ) ;
3103
- let path = external_path ( cx, & cx. tcx . item_name ( did) . as_str ( ) ,
3102
+ let path = external_path ( cx, cx. tcx . item_name ( did) ,
3104
3103
None , false , vec ! [ ] , InternalSubsts :: empty ( ) ) ;
3105
3104
ResolvedPath {
3106
3105
path : path,
@@ -3129,7 +3128,7 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
3129
3128
reg. clean ( cx) . map ( |b| param_names. push ( GenericBound :: Outlives ( b) ) ) ;
3130
3129
for did in dids {
3131
3130
let empty = cx. tcx . intern_substs ( & [ ] ) ;
3132
- let path = external_path ( cx, & cx. tcx . item_name ( did) . as_str ( ) ,
3131
+ let path = external_path ( cx, cx. tcx . item_name ( did) ,
3133
3132
Some ( did) , false , vec ! [ ] , empty) ;
3134
3133
inline:: record_extern_fqn ( cx, did, TypeKind :: Trait ) ;
3135
3134
let bound = GenericBound :: TraitBound ( PolyTrait {
@@ -3154,7 +3153,7 @@ impl<'tcx> Clean<Type> for Ty<'tcx> {
3154
3153
} ) ;
3155
3154
}
3156
3155
3157
- let path = external_path ( cx, & cx. tcx . item_name ( did) . as_str ( ) , Some ( did) ,
3156
+ let path = external_path ( cx, cx. tcx . item_name ( did) , Some ( did) ,
3158
3157
false , bindings, substs) ;
3159
3158
ResolvedPath {
3160
3159
path,
0 commit comments