diff options
| author | bors <bors@rust-lang.org> | 2025-04-19 16:03:34 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-04-19 16:03:34 +0000 |
| commit | 077cedc2afa8ac0b727b7a6cbe012940ba228deb (patch) | |
| tree | 8071bf6a1c05c6114d729698a9b9fc25d60d921e /compiler/rustc_parse/src/parser/expr.rs | |
| parent | a7c39b68616668a45f0afd62849a1da7c8ad2516 (diff) | |
| parent | 9ebc73e2b62cfd2c678b84bfad9e6cf86a315a97 (diff) | |
| download | rust-077cedc2afa8ac0b727b7a6cbe012940ba228deb.tar.gz rust-077cedc2afa8ac0b727b7a6cbe012940ba228deb.zip | |
Auto merge of #140040 - ChrisDenton:rollup-56bzfuq, r=ChrisDenton
Rollup of 8 pull requests Successful merges: - #137454 (not lint break with label and unsafe block) - #139297 (Deduplicate & clean up Nix shell) - #139535 (Implement `Default` for raw pointers) - #139919 (Make rustdoc JSON Span column 1-based, just like line numbers) - #139922 (fix incorrect type in cstr `to_string_lossy()` docs) - #140007 (Disable has_thread_local on i686-win7-windows-msvc) - #140016 (std: Use fstatat() on illumos) - #140025 (Re-remove `AdtFlags::IS_ANONYMOUS`) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index df44b3cc23c..71cc814cb50 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -1884,13 +1884,15 @@ impl<'a> Parser<'a> { let mut expr = self.parse_expr_opt()?; if let Some(expr) = &mut expr { if label.is_some() - && matches!( - expr.kind, + && match &expr.kind { ExprKind::While(_, _, None) - | ExprKind::ForLoop { label: None, .. } - | ExprKind::Loop(_, None, _) - | ExprKind::Block(_, None) - ) + | ExprKind::ForLoop { label: None, .. } + | ExprKind::Loop(_, None, _) => true, + ExprKind::Block(block, None) => { + matches!(block.rules, BlockCheckMode::Default) + } + _ => false, + } { self.psess.buffer_lint( BREAK_WITH_LABEL_AND_LOOP, |
