@@ -23,6 +23,7 @@ impl<S: Stage> SingleAttributeParser<S> for OptimizeParser {
2323 Allow ( Target :: Fn ) ,
2424 Allow ( Target :: Closure ) ,
2525 Allow ( Target :: Method ( MethodKind :: Trait { body : true } ) ) ,
26+ Allow ( Target :: Method ( MethodKind :: TraitImpl ) ) ,
2627 Allow ( Target :: Method ( MethodKind :: Inherent ) ) ,
2728 ] ) ;
2829 const TEMPLATE : AttributeTemplate = template ! ( List : "size|speed|none" ) ;
@@ -60,6 +61,7 @@ impl<S: Stage> NoArgsAttributeParser<S> for ColdParser {
6061 const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowListWarnRest ( & [
6162 Allow ( Target :: Fn ) ,
6263 Allow ( Target :: Method ( MethodKind :: Trait { body : true } ) ) ,
64+ Allow ( Target :: Method ( MethodKind :: TraitImpl ) ) ,
6365 Allow ( Target :: Method ( MethodKind :: Trait { body : false } ) ) ,
6466 Allow ( Target :: Method ( MethodKind :: Inherent ) ) ,
6567 Allow ( Target :: ForeignFn ) ,
@@ -78,6 +80,7 @@ impl<S: Stage> SingleAttributeParser<S> for CoverageParser {
7880 Allow ( Target :: Fn ) ,
7981 Allow ( Target :: Closure ) ,
8082 Allow ( Target :: Method ( MethodKind :: Trait { body : true } ) ) ,
83+ Allow ( Target :: Method ( MethodKind :: TraitImpl ) ) ,
8184 Allow ( Target :: Method ( MethodKind :: Inherent ) ) ,
8285 Allow ( Target :: Impl { of_trait : true } ) ,
8386 Allow ( Target :: Impl { of_trait : false } ) ,
@@ -127,6 +130,7 @@ impl<S: Stage> SingleAttributeParser<S> for ExportNameParser {
127130 Allow ( Target :: Fn ) ,
128131 Allow ( Target :: Method ( MethodKind :: Inherent ) ) ,
129132 Allow ( Target :: Method ( MethodKind :: Trait { body : true } ) ) ,
133+ Allow ( Target :: Method ( MethodKind :: TraitImpl ) ) ,
130134 Warn ( Target :: Field ) ,
131135 Warn ( Target :: Arm ) ,
132136 Warn ( Target :: MacroDef ) ,
@@ -176,6 +180,7 @@ impl<S: Stage> AttributeParser<S> for NakedParser {
176180 Allow ( Target :: Fn ) ,
177181 Allow ( Target :: Method ( MethodKind :: Inherent ) ) ,
178182 Allow ( Target :: Method ( MethodKind :: Trait { body : true } ) ) ,
183+ Allow ( Target :: Method ( MethodKind :: TraitImpl ) ) ,
179184 ] ) ;
180185
181186 fn finalize ( self , cx : & FinalizeContext < ' _ , ' _ , S > ) -> Option < AttributeKind > {
@@ -273,6 +278,7 @@ impl<S: Stage> NoArgsAttributeParser<S> for TrackCallerParser {
273278 Allow ( Target :: Fn ) ,
274279 Allow ( Target :: Method ( MethodKind :: Inherent ) ) ,
275280 Allow ( Target :: Method ( MethodKind :: Trait { body : true } ) ) ,
281+ Allow ( Target :: Method ( MethodKind :: TraitImpl ) ) ,
276282 Allow ( Target :: Method ( MethodKind :: Trait { body : false } ) ) ,
277283 Allow ( Target :: ForeignFn ) ,
278284 Allow ( Target :: Closure ) ,
@@ -291,8 +297,7 @@ impl<S: Stage> NoArgsAttributeParser<S> for NoMangleParser {
291297 Allow ( Target :: Fn ) ,
292298 Allow ( Target :: Static ) ,
293299 Allow ( Target :: Method ( MethodKind :: Inherent ) ) ,
294- Allow ( Target :: Method ( MethodKind :: Trait { body : true } ) ) ,
295- Allow ( Target :: Method ( MethodKind :: Trait { body : false } ) ) ,
300+ Allow ( Target :: Method ( MethodKind :: TraitImpl ) ) ,
296301 ] ) ;
297302 const CREATE : fn ( Span ) -> AttributeKind = AttributeKind :: NoMangle ;
298303}
@@ -436,6 +441,7 @@ impl<S: Stage> CombineAttributeParser<S> for TargetFeatureParser {
436441 Allow ( Target :: Fn ) ,
437442 Allow ( Target :: Method ( MethodKind :: Inherent ) ) ,
438443 Allow ( Target :: Method ( MethodKind :: Trait { body : true } ) ) ,
444+ Allow ( Target :: Method ( MethodKind :: TraitImpl ) ) ,
439445 Warn ( Target :: Statement ) ,
440446 Warn ( Target :: Field ) ,
441447 Warn ( Target :: Arm ) ,
0 commit comments