This commit is contained in:
Lukas Wirth 2023-03-27 17:16:45 +02:00
parent f85fc28508
commit c04a13cb19

View file

@ -1083,9 +1083,9 @@ impl ExprCollector<'_> {
.collect(), .collect(),
} }
} }
// FIXME: rustfmt removes this label if it is a block and not a loop #[rustfmt::skip] // https://github.com/rust-lang/rustfmt/issues/5676
ast::Pat::LiteralPat(lit) => 'b: loop { ast::Pat::LiteralPat(lit) => 'b: {
break if let Some(ast_lit) = lit.literal() { if let Some(ast_lit) = lit.literal() {
let mut hir_lit: Literal = ast_lit.kind().into(); let mut hir_lit: Literal = ast_lit.kind().into();
if lit.minus_token().is_some() { if lit.minus_token().is_some() {
let Some(h) = hir_lit.negate() else { let Some(h) = hir_lit.negate() else {
@ -1099,7 +1099,7 @@ impl ExprCollector<'_> {
Pat::Lit(expr_id) Pat::Lit(expr_id)
} else { } else {
Pat::Missing Pat::Missing
}; }
}, },
ast::Pat::RestPat(_) => { ast::Pat::RestPat(_) => {
// `RestPat` requires special handling and should not be mapped // `RestPat` requires special handling and should not be mapped