@@ -147,6 +147,9 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
147147 | AttributeKind :: ConstStabilityIndirect
148148 | AttributeKind :: MacroTransparency ( _) ,
149149 ) => { /* do nothing */ }
150+ Attribute :: Parsed ( AttributeKind :: MayDangle ( _) ) => {
151+ self . check_may_dangle ( hir_id, attr)
152+ }
150153 Attribute :: Unparsed ( _) => {
151154 match attr. path ( ) . as_slice ( ) {
152155 [ sym:: diagnostic, sym:: do_not_recommend, ..] => {
@@ -225,7 +228,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
225228 [ sym:: collapse_debuginfo, ..] => self . check_collapse_debuginfo ( attr, span, target) ,
226229 [ sym:: must_not_suspend, ..] => self . check_must_not_suspend ( attr, span, target) ,
227230 [ sym:: must_use, ..] => self . check_must_use ( hir_id, attr, target) ,
228- [ sym:: may_dangle, ..] => self . check_may_dangle ( hir_id, attr) ,
229231 [ sym:: rustc_pass_by_value, ..] => self . check_pass_by_value ( attr, span, target) ,
230232 [ sym:: rustc_allow_incoherent_impl, ..] => {
231233 self . check_allow_incoherent_impl ( attr, span, target)
0 commit comments