@@ -193,9 +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 :: ConstContinue ( attr_span) => {
197- self . check_const_continue ( hir_id, * attr_span, target)
198- }
199196 AttributeKind :: AllowInternalUnsafe ( attr_span)
200197 | AttributeKind :: AllowInternalUnstable ( .., attr_span) => {
201198 self . check_macro_only_attr ( * attr_span, span, target, attrs)
@@ -215,7 +212,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
215212 & AttributeKind :: RustcPubTransparent ( attr_span) => {
216213 self . check_rustc_pub_transparent ( attr_span, span, attrs)
217214 }
218- AttributeKind :: RustcAlign { .. } => { }
219215 AttributeKind :: Naked ( ..) => self . check_naked ( hir_id, target) ,
220216 AttributeKind :: TrackCaller ( attr_span) => {
221217 self . check_track_caller ( hir_id, * attr_span, attrs, target)
@@ -259,6 +255,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
259255 AttributeKind :: Cold => ( ) ,
260256 AttributeKind :: CollapseDebugInfo ( ..) => ( ) ,
261257 AttributeKind :: CompilerBuiltins => ( ) ,
258+ AttributeKind :: ConstContinue ( ..) => { }
262259 AttributeKind :: Coroutine => ( ) ,
263260 AttributeKind :: Coverage ( ..) => ( ) ,
264261 AttributeKind :: CrateName { .. } => ( ) ,
@@ -315,6 +312,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
315312 // handled below this loop and elsewhere
316313 AttributeKind :: Repr { .. } => ( ) ,
317314 AttributeKind :: RustcAbi { .. } => ( ) ,
315+ AttributeKind :: RustcAlign { .. } => { }
318316 AttributeKind :: RustcAllocator => ( ) ,
319317 AttributeKind :: RustcAllocatorZeroed => ( ) ,
320318 AttributeKind :: RustcAllocatorZeroedVariant { .. } => ( ) ,
@@ -889,7 +887,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
889887 | Target :: Delegation { .. }
890888 | Target :: Loop
891889 | Target :: ForLoop
892- | Target :: While => None ,
890+ | Target :: While
891+ | Target :: Break => None ,
893892 } {
894893 self . tcx . dcx ( ) . emit_err ( diagnostics:: DocAliasBadLocation { span, location } ) ;
895894 return ;
@@ -1660,18 +1659,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
16601659 . emit_err ( diagnostics:: BothOptimizeNoneAndInline { optimize_span, inline_span } ) ;
16611660 }
16621661 }
1663-
1664- fn check_const_continue ( & self , hir_id : HirId , attr_span : Span , target : Target ) {
1665- let node_span = self . tcx . hir_span ( hir_id) ;
1666-
1667- if !matches ! ( target, Target :: Expression ) {
1668- return ; // Handled in target checking during attr parse
1669- }
1670-
1671- if !matches ! ( self . tcx. hir_expect_expr( hir_id) . kind, hir:: ExprKind :: Break ( ..) ) {
1672- self . dcx ( ) . emit_err ( diagnostics:: ConstContinueAttr { attr_span, node_span } ) ;
1673- } ;
1674- }
16751662}
16761663
16771664impl < ' tcx > Visitor < ' tcx > for CheckAttrVisitor < ' tcx > {
0 commit comments