@@ -1093,13 +1093,15 @@ impl Attribute {
10931093}
10941094
10951095impl AttributeExt for Attribute {
1096+ #[ inline]
10961097 fn id ( & self ) -> AttrId {
10971098 match & self {
10981099 Attribute :: Unparsed ( u) => u. id . attr_id ,
10991100 _ => panic ! ( ) ,
11001101 }
11011102 }
11021103
1104+ #[ inline]
11031105 fn meta_item_list ( & self ) -> Option < ThinVec < ast:: MetaItemInner > > {
11041106 match & self {
11051107 Attribute :: Unparsed ( n) => match n. as_ref ( ) {
@@ -1112,15 +1114,18 @@ impl AttributeExt for Attribute {
11121114 }
11131115 }
11141116
1117+ #[ inline]
11151118 fn value_str ( & self ) -> Option < Symbol > {
11161119 self . value_lit ( ) . and_then ( |x| x. value_str ( ) )
11171120 }
11181121
1122+ #[ inline]
11191123 fn value_span ( & self ) -> Option < Span > {
11201124 self . value_lit ( ) . map ( |i| i. span )
11211125 }
11221126
11231127 /// For a single-segment attribute, returns its name; otherwise, returns `None`.
1128+ #[ inline]
11241129 fn ident ( & self ) -> Option < Ident > {
11251130 match & self {
11261131 Attribute :: Unparsed ( n) => {
@@ -1134,6 +1139,7 @@ impl AttributeExt for Attribute {
11341139 }
11351140 }
11361141
1142+ #[ inline]
11371143 fn path_matches ( & self , name : & [ Symbol ] ) -> bool {
11381144 match & self {
11391145 Attribute :: Unparsed ( n) => {
@@ -1144,11 +1150,12 @@ impl AttributeExt for Attribute {
11441150 }
11451151 }
11461152
1153+ #[ inline]
11471154 fn is_doc_comment ( & self ) -> bool {
1148- // FIXME(jdonszelmann): make the 2nd check unnecessary here
11491155 matches ! ( self , Attribute :: Parsed ( AttributeKind :: DocComment { .. } ) )
11501156 }
11511157
1158+ #[ inline]
11521159 fn span ( & self ) -> Span {
11531160 match & self {
11541161 Attribute :: Unparsed ( u) => u. span ,
@@ -1159,6 +1166,7 @@ impl AttributeExt for Attribute {
11591166 }
11601167 }
11611168
1169+ #[ inline]
11621170 fn is_word ( & self ) -> bool {
11631171 match & self {
11641172 Attribute :: Unparsed ( n) => {
@@ -1168,20 +1176,23 @@ impl AttributeExt for Attribute {
11681176 }
11691177 }
11701178
1179+ #[ inline]
11711180 fn ident_path ( & self ) -> Option < SmallVec < [ Ident ; 1 ] > > {
11721181 match & self {
11731182 Attribute :: Unparsed ( n) => Some ( n. path . segments . iter ( ) . copied ( ) . collect ( ) ) ,
11741183 _ => None ,
11751184 }
11761185 }
11771186
1187+ #[ inline]
11781188 fn doc_str ( & self ) -> Option < Symbol > {
11791189 match & self {
11801190 Attribute :: Parsed ( AttributeKind :: DocComment { comment, .. } ) => Some ( * comment) ,
11811191 Attribute :: Unparsed ( _) if self . has_name ( sym:: doc) => self . value_str ( ) ,
11821192 _ => None ,
11831193 }
11841194 }
1195+ #[ inline]
11851196 fn doc_str_and_comment_kind ( & self ) -> Option < ( Symbol , CommentKind ) > {
11861197 match & self {
11871198 Attribute :: Parsed ( AttributeKind :: DocComment { kind, comment, .. } ) => {
@@ -1194,6 +1205,7 @@ impl AttributeExt for Attribute {
11941205 }
11951206 }
11961207
1208+ #[ inline]
11971209 fn style ( & self ) -> AttrStyle {
11981210 match & self {
11991211 Attribute :: Unparsed ( u) => u. style ,
@@ -1205,34 +1217,42 @@ impl AttributeExt for Attribute {
12051217
12061218// FIXME(fn_delegation): use function delegation instead of manually forwarding
12071219impl Attribute {
1220+ #[ inline]
12081221 pub fn id ( & self ) -> AttrId {
12091222 AttributeExt :: id ( self )
12101223 }
12111224
1225+ #[ inline]
12121226 pub fn name_or_empty ( & self ) -> Symbol {
12131227 AttributeExt :: name_or_empty ( self )
12141228 }
12151229
1230+ #[ inline]
12161231 pub fn meta_item_list ( & self ) -> Option < ThinVec < MetaItemInner > > {
12171232 AttributeExt :: meta_item_list ( self )
12181233 }
12191234
1235+ #[ inline]
12201236 pub fn value_str ( & self ) -> Option < Symbol > {
12211237 AttributeExt :: value_str ( self )
12221238 }
12231239
1240+ #[ inline]
12241241 pub fn value_span ( & self ) -> Option < Span > {
12251242 AttributeExt :: value_span ( self )
12261243 }
12271244
1245+ #[ inline]
12281246 pub fn ident ( & self ) -> Option < Ident > {
12291247 AttributeExt :: ident ( self )
12301248 }
12311249
1250+ #[ inline]
12321251 pub fn path_matches ( & self , name : & [ Symbol ] ) -> bool {
12331252 AttributeExt :: path_matches ( self , name)
12341253 }
12351254
1255+ #[ inline]
12361256 pub fn is_doc_comment ( & self ) -> bool {
12371257 AttributeExt :: is_doc_comment ( self )
12381258 }
@@ -1242,34 +1262,42 @@ impl Attribute {
12421262 AttributeExt :: has_name ( self , name)
12431263 }
12441264
1265+ #[ inline]
12451266 pub fn span ( & self ) -> Span {
12461267 AttributeExt :: span ( self )
12471268 }
12481269
1270+ #[ inline]
12491271 pub fn is_word ( & self ) -> bool {
12501272 AttributeExt :: is_word ( self )
12511273 }
12521274
1275+ #[ inline]
12531276 pub fn path ( & self ) -> SmallVec < [ Symbol ; 1 ] > {
12541277 AttributeExt :: path ( self )
12551278 }
12561279
1280+ #[ inline]
12571281 pub fn ident_path ( & self ) -> Option < SmallVec < [ Ident ; 1 ] > > {
12581282 AttributeExt :: ident_path ( self )
12591283 }
12601284
1285+ #[ inline]
12611286 pub fn doc_str ( & self ) -> Option < Symbol > {
12621287 AttributeExt :: doc_str ( self )
12631288 }
12641289
1290+ #[ inline]
12651291 pub fn is_proc_macro_attr ( & self ) -> bool {
12661292 AttributeExt :: is_proc_macro_attr ( self )
12671293 }
12681294
1295+ #[ inline]
12691296 pub fn doc_str_and_comment_kind ( & self ) -> Option < ( Symbol , CommentKind ) > {
12701297 AttributeExt :: doc_str_and_comment_kind ( self )
12711298 }
12721299
1300+ #[ inline]
12731301 pub fn style ( & self ) -> AttrStyle {
12741302 AttributeExt :: style ( self )
12751303 }
0 commit comments