File tree 1 file changed +24
-4
lines changed
compiler/rustc_passes/src
1 file changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -619,10 +619,30 @@ impl CheckAttrVisitor<'_> {
619
619
}
620
620
// we check the validity of params elsewhere
621
621
Target :: Param => return false ,
622
- Target :: Expression => Some ( "expression" ) ,
623
- Target :: Statement => Some ( "statement" ) ,
624
- Target :: Arm => Some ( "match arm" ) ,
625
- _ => None ,
622
+ Target :: Expression | Target :: Statement | Target :: Arm => Some ( target. name ( ) ) ,
623
+ Target :: ExternCrate
624
+ | Target :: Use
625
+ | Target :: Static
626
+ | Target :: Const
627
+ | Target :: Fn
628
+ | Target :: Closure
629
+ | Target :: Mod
630
+ | Target :: GlobalAsm
631
+ | Target :: TyAlias
632
+ | Target :: OpaqueTy
633
+ | Target :: Enum
634
+ | Target :: Variant
635
+ | Target :: Struct
636
+ | Target :: Field
637
+ | Target :: Union
638
+ | Target :: Trait
639
+ | Target :: TraitAlias
640
+ | Target :: Method ( ..)
641
+ | Target :: ForeignFn
642
+ | Target :: ForeignStatic
643
+ | Target :: ForeignTy
644
+ | Target :: GenericParam ( ..)
645
+ | Target :: MacroDef => None ,
626
646
} {
627
647
tcx. sess . emit_err ( errors:: DocAliasBadLocation { span, attr_str, location } ) ;
628
648
return false ;
You can’t perform that action at this time.
0 commit comments