@@ -917,6 +917,10 @@ crate struct DocFragment {
917917 crate indent : usize ,
918918}
919919
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+
920924#[ derive( Clone , Copy , PartialEq , Eq , Debug , Hash ) ]
921925crate enum DocFragmentKind {
922926 /// A doc fragment created from a `///` or `//!` doc comment.
@@ -1109,24 +1113,24 @@ impl Attributes {
11091113 if self . doc_strings . is_empty ( ) { None } else { Some ( self . doc_strings . iter ( ) . collect ( ) ) }
11101114 }
11111115
1112- crate fn get_doc_aliases ( & self ) -> Box < [ String ] > {
1116+ crate fn get_doc_aliases ( & self ) -> Box < [ Symbol ] > {
11131117 let mut aliases = FxHashSet :: default ( ) ;
11141118
11151119 for attr in self . other_attrs . lists ( sym:: doc) . filter ( |a| a. has_name ( sym:: alias) ) {
11161120 if let Some ( values) = attr. meta_item_list ( ) {
11171121 for l in values {
11181122 match l. literal ( ) . unwrap ( ) . kind {
11191123 ast:: LitKind :: Str ( s, _) => {
1120- aliases. insert ( s. as_str ( ) . to_string ( ) ) ;
1124+ aliases. insert ( s) ;
11211125 }
11221126 _ => unreachable ! ( ) ,
11231127 }
11241128 }
11251129 } else {
1126- aliases. insert ( attr. value_str ( ) . map ( |s| s . to_string ( ) ) . unwrap ( ) ) ;
1130+ aliases. insert ( attr. value_str ( ) . unwrap ( ) ) ;
11271131 }
11281132 }
1129- aliases. into_iter ( ) . collect :: < Vec < String > > ( ) . into ( )
1133+ aliases. into_iter ( ) . collect :: < Vec < _ > > ( ) . into ( )
11301134 }
11311135}
11321136
0 commit comments