@@ -15,8 +15,8 @@ use rustc_span::{BytePos, Span};
15
15
use Context :: * ;
16
16
17
17
use crate :: errors:: {
18
- BreakInsideClosure , BreakInsideCoroutine , BreakNonLoop , ContinueLabeledBlock , OutsideLoop ,
19
- OutsideLoopSuggestion , UnlabeledCfInWhileCondition , UnlabeledInLabeledBlock ,
18
+ BreakInsideClosure , BreakInsideCoroutine , BreakNonLoop , OutsideLoop , OutsideLoopSuggestion ,
19
+ UnlabeledCfInWhileCondition , UnlabeledInLabeledBlock ,
20
20
} ;
21
21
22
22
#[ derive( Clone , Copy , Debug , PartialEq ) ]
@@ -266,13 +266,9 @@ impl<'a, 'hir> Visitor<'hir> for CheckLoopVisitor<'a, 'hir> {
266
266
self . require_label_in_labeled_block ( e. span , & destination, "continue" ) ;
267
267
268
268
match destination. target_id {
269
- Ok ( loop_id) => {
270
- if let Node :: Block ( block) = self . tcx . hir_node ( loop_id) {
271
- self . sess . dcx ( ) . emit_err ( ContinueLabeledBlock {
272
- span : e. span ,
273
- block_span : block. span ,
274
- } ) ;
275
- }
269
+ Ok ( _loop_id) => {
270
+ // We have already insured that the loop exists while lowering the ast.
271
+ // See `compiler/rustc_ast_lowering/src/expr.rs::LoweringContext::lower_expr_mut`
276
272
}
277
273
Err ( hir:: LoopIdError :: UnlabeledCfInWhileCondition ) => {
278
274
self . sess . dcx ( ) . emit_err ( UnlabeledCfInWhileCondition {
0 commit comments