File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
compiler/rustc_attr_parsing/src/attributes Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ impl<S: Stage> NoArgsAttributeParser<S> for ColdParser {
5757 Allow ( Target :: Fn ) ,
5858 Allow ( Target :: Method ( MethodKind :: Trait { body : true } ) ) ,
5959 Allow ( Target :: Method ( MethodKind :: TraitImpl ) ) ,
60+ Error ( Target :: Method ( MethodKind :: Trait { body : false } ) ) ,
6061 Allow ( Target :: Method ( MethodKind :: Inherent ) ) ,
6162 Allow ( Target :: ForeignFn ) ,
6263 Allow ( Target :: Closure ) ,
Original file line number Diff line number Diff line change @@ -472,6 +472,7 @@ impl<S: Stage> SingleAttributeParser<S> for LinkSectionParser {
472472 Allow ( Target :: Method ( MethodKind :: Inherent ) ) ,
473473 Allow ( Target :: Method ( MethodKind :: Trait { body : true } ) ) ,
474474 Allow ( Target :: Method ( MethodKind :: TraitImpl ) ) ,
475+ Error ( Target :: Method ( MethodKind :: Trait { body : false } ) ) ,
475476 ] ) ;
476477 const TEMPLATE : AttributeTemplate = template ! (
477478 NameValueStr : "name" ,
@@ -592,7 +593,7 @@ impl<S: Stage> SingleAttributeParser<S> for LinkageParser {
592593 Allow ( Target :: Static ) ,
593594 Allow ( Target :: ForeignStatic ) ,
594595 Allow ( Target :: ForeignFn ) ,
595- Warn ( Target :: Method ( MethodKind :: Trait { body : false } ) ) , // Not inherited
596+ Error ( Target :: Method ( MethodKind :: Trait { body : false } ) ) , // Not inherited
596597 ] ) ;
597598
598599 const TEMPLATE : AttributeTemplate = template ! ( NameValueStr : [
You can’t perform that action at this time.
0 commit comments