File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
compiler/rustc_attr_parsing/src/attributes Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -243,7 +243,21 @@ impl<S: Stage> AttributeParser<S> for ConstStabilityParser {
243243 this. promotable = true ;
244244 } ) ,
245245 ] ;
246- const ALLOWED_TARGETS : AllowedTargets = ALLOWED_TARGETS ;
246+ const ALLOWED_TARGETS : AllowedTargets = AllowedTargets :: AllowList ( & [
247+ Allow ( Target :: Fn ) ,
248+ Allow ( Target :: Method ( MethodKind :: Inherent ) ) ,
249+ Allow ( Target :: Method ( MethodKind :: TraitImpl ) ) ,
250+ Allow ( Target :: Method ( MethodKind :: Trait { body : true } ) ) ,
251+ Allow ( Target :: Impl { of_trait : false } ) ,
252+ Allow ( Target :: Impl { of_trait : true } ) ,
253+ Allow ( Target :: Use ) , // FIXME I don't think this does anything?
254+ Allow ( Target :: Const ) ,
255+ Allow ( Target :: AssocConst ) ,
256+ Allow ( Target :: Trait ) ,
257+ Allow ( Target :: Static ) ,
258+ Allow ( Target :: Crate ) ,
259+ Allow ( Target :: MacroDef ) , // FIXME(oli-obk): remove this and eliminate the manual check for it
260+ ] ) ;
247261
248262 fn finalize ( mut self , cx : & FinalizeContext < ' _ , ' _ , S > ) -> Option < AttributeKind > {
249263 if self . promotable {
You can’t perform that action at this time.
0 commit comments