@@ -917,6 +917,10 @@ crate struct DocFragment {
917
917
crate indent : usize ,
918
918
}
919
919
920
+ // `DocFragment` is used a lot. Make sure it doesn't unintentionally get bigger.
921
+ #[ cfg( all( target_arch = "x86_64" , target_pointer_width = "64" ) ) ]
922
+ rustc_data_structures:: static_assert_size!( DocFragment , 32 ) ;
923
+
920
924
#[ derive( Clone , Copy , PartialEq , Eq , Debug , Hash ) ]
921
925
crate enum DocFragmentKind {
922
926
/// A doc fragment created from a `///` or `//!` doc comment.
@@ -1109,24 +1113,24 @@ impl Attributes {
1109
1113
if self . doc_strings . is_empty ( ) { None } else { Some ( self . doc_strings . iter ( ) . collect ( ) ) }
1110
1114
}
1111
1115
1112
- crate fn get_doc_aliases ( & self ) -> Box < [ String ] > {
1116
+ crate fn get_doc_aliases ( & self ) -> Box < [ Symbol ] > {
1113
1117
let mut aliases = FxHashSet :: default ( ) ;
1114
1118
1115
1119
for attr in self . other_attrs . lists ( sym:: doc) . filter ( |a| a. has_name ( sym:: alias) ) {
1116
1120
if let Some ( values) = attr. meta_item_list ( ) {
1117
1121
for l in values {
1118
1122
match l. literal ( ) . unwrap ( ) . kind {
1119
1123
ast:: LitKind :: Str ( s, _) => {
1120
- aliases. insert ( s. as_str ( ) . to_string ( ) ) ;
1124
+ aliases. insert ( s) ;
1121
1125
}
1122
1126
_ => unreachable ! ( ) ,
1123
1127
}
1124
1128
}
1125
1129
} else {
1126
- aliases. insert ( attr. value_str ( ) . map ( |s| s . to_string ( ) ) . unwrap ( ) ) ;
1130
+ aliases. insert ( attr. value_str ( ) . unwrap ( ) ) ;
1127
1131
}
1128
1132
}
1129
- aliases. into_iter ( ) . collect :: < Vec < String > > ( ) . into ( )
1133
+ aliases. into_iter ( ) . collect :: < Vec < _ > > ( ) . into ( )
1130
1134
}
1131
1135
}
1132
1136
0 commit comments