about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2023-03-27 17:16:45 +0200
committerLukas Wirth <lukastw97@gmail.com>2023-03-27 17:16:45 +0200
commitc04a13cb1982fbdb207825a3213e2bc94ddcb836 (patch)
tree87be807c9fdd6b1da1fa96268708ff215440bbdd
parentf85fc285088129a131ecb83398d9f66922e0830e (diff)
downloadrust-c04a13cb1982fbdb207825a3213e2bc94ddcb836.tar.gz
rust-c04a13cb1982fbdb207825a3213e2bc94ddcb836.zip
Simplify
-rw-r--r--crates/hir-def/src/body/lower.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/hir-def/src/body/lower.rs b/crates/hir-def/src/body/lower.rs
index 3fb3e4f68dd..886d71ebeda 100644
--- a/crates/hir-def/src/body/lower.rs
+++ b/crates/hir-def/src/body/lower.rs
@@ -1083,9 +1083,9 @@ impl ExprCollector<'_> {
                         .collect(),
                 }
             }
-            // FIXME: rustfmt removes this label if it is a block and not a loop
-            ast::Pat::LiteralPat(lit) => 'b: loop {
-                break if let Some(ast_lit) = lit.literal() {
+            #[rustfmt::skip] // https://github.com/rust-lang/rustfmt/issues/5676
+            ast::Pat::LiteralPat(lit) => 'b: {
+                if let Some(ast_lit) = lit.literal() {
                     let mut hir_lit: Literal = ast_lit.kind().into();
                     if lit.minus_token().is_some() {
                         let Some(h) = hir_lit.negate() else {
@@ -1099,7 +1099,7 @@ impl ExprCollector<'_> {
                     Pat::Lit(expr_id)
                 } else {
                     Pat::Missing
-                };
+                }
             },
             ast::Pat::RestPat(_) => {
                 // `RestPat` requires special handling and should not be mapped