@@ -193,12 +193,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
193193 AttributeKind :: Inline ( kind, attr_span) => {
194194 self . check_inline ( hir_id, * attr_span, kind, target)
195195 }
196- AttributeKind :: LoopMatch ( attr_span) => {
197- self . check_loop_match ( hir_id, * attr_span, target)
198- }
199- AttributeKind :: ConstContinue ( attr_span) => {
200- self . check_const_continue ( hir_id, * attr_span, target)
201- }
202196 AttributeKind :: AllowInternalUnsafe ( attr_span)
203197 | AttributeKind :: AllowInternalUnstable ( .., attr_span) => {
204198 self . check_macro_only_attr ( * attr_span, span, target, attrs)
@@ -218,7 +212,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
218212 & AttributeKind :: RustcPubTransparent ( attr_span) => {
219213 self . check_rustc_pub_transparent ( attr_span, span, attrs)
220214 }
221- AttributeKind :: RustcAlign { .. } => { }
222215 AttributeKind :: Naked ( ..) => self . check_naked ( hir_id, target) ,
223216 AttributeKind :: TrackCaller ( attr_span) => {
224217 self . check_track_caller ( hir_id, * attr_span, attrs, target)
@@ -262,6 +255,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
262255 AttributeKind :: Cold => ( ) ,
263256 AttributeKind :: CollapseDebugInfo ( ..) => ( ) ,
264257 AttributeKind :: CompilerBuiltins => ( ) ,
258+ AttributeKind :: ConstContinue ( ..) => { }
265259 AttributeKind :: Coroutine => ( ) ,
266260 AttributeKind :: Coverage ( ..) => ( ) ,
267261 AttributeKind :: CrateName { .. } => ( ) ,
@@ -286,6 +280,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
286280 AttributeKind :: LinkOrdinal { .. } => ( ) ,
287281 AttributeKind :: LinkSection { .. } => ( ) ,
288282 AttributeKind :: Linkage ( ..) => ( ) ,
283+ AttributeKind :: LoopMatch ( ..) => { }
289284 AttributeKind :: MacroEscape => ( ) ,
290285 AttributeKind :: MacroUse { .. } => ( ) ,
291286 AttributeKind :: Marker => ( ) ,
@@ -317,6 +312,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
317312 // handled below this loop and elsewhere
318313 AttributeKind :: Repr { .. } => ( ) ,
319314 AttributeKind :: RustcAbi { .. } => ( ) ,
315+ AttributeKind :: RustcAlign { .. } => { }
320316 AttributeKind :: RustcAllocator => ( ) ,
321317 AttributeKind :: RustcAllocatorZeroed => ( ) ,
322318 AttributeKind :: RustcAllocatorZeroedVariant { .. } => ( ) ,
@@ -891,7 +887,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
891887 | Target :: Delegation { .. }
892888 | Target :: Loop
893889 | Target :: ForLoop
894- | Target :: While => None ,
890+ | Target :: While
891+ | Target :: Break => None ,
895892 } {
896893 self . tcx . dcx ( ) . emit_err ( diagnostics:: DocAliasBadLocation { span, location } ) ;
897894 return ;
@@ -1662,30 +1659,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
16621659 . emit_err ( diagnostics:: BothOptimizeNoneAndInline { optimize_span, inline_span } ) ;
16631660 }
16641661 }
1665-
1666- fn check_loop_match ( & self , hir_id : HirId , attr_span : Span , target : Target ) {
1667- let node_span = self . tcx . hir_span ( hir_id) ;
1668-
1669- if !matches ! ( target, Target :: Expression ) {
1670- return ; // Handled in target checking during attr parse
1671- }
1672-
1673- if !matches ! ( self . tcx. hir_expect_expr( hir_id) . kind, hir:: ExprKind :: Loop ( ..) ) {
1674- self . dcx ( ) . emit_err ( diagnostics:: LoopMatchAttr { attr_span, node_span } ) ;
1675- } ;
1676- }
1677-
1678- fn check_const_continue ( & self , hir_id : HirId , attr_span : Span , target : Target ) {
1679- let node_span = self . tcx . hir_span ( hir_id) ;
1680-
1681- if !matches ! ( target, Target :: Expression ) {
1682- return ; // Handled in target checking during attr parse
1683- }
1684-
1685- if !matches ! ( self . tcx. hir_expect_expr( hir_id) . kind, hir:: ExprKind :: Break ( ..) ) {
1686- self . dcx ( ) . emit_err ( diagnostics:: ConstContinueAttr { attr_span, node_span } ) ;
1687- } ;
1688- }
16891662}
16901663
16911664impl < ' tcx > Visitor < ' tcx > for CheckAttrVisitor < ' tcx > {
0 commit comments