diff options
Diffstat (limited to 'compiler/rustc_ast_lowering/src')
| -rw-r--r-- | compiler/rustc_ast_lowering/src/asm.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_ast_lowering/src/expr.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_ast_lowering/src/item.rs | 5 |
3 files changed, 6 insertions, 9 deletions
diff --git a/compiler/rustc_ast_lowering/src/asm.rs b/compiler/rustc_ast_lowering/src/asm.rs index 5a85356d96d..17425fb0a6e 100644 --- a/compiler/rustc_ast_lowering/src/asm.rs +++ b/compiler/rustc_ast_lowering/src/asm.rs @@ -338,9 +338,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { let idx2 = *o.get(); let &(ref op2, op_sp2) = &operands[idx2]; - let reg2 = match op2.reg() { - Some(asm::InlineAsmRegOrRegClass::Reg(r)) => r, - _ => unreachable!(), + let Some(asm::InlineAsmRegOrRegClass::Reg(reg2)) = op2.reg() else { + unreachable!(); }; let msg = format!( diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs index 17bc8d7591b..0b7bf09cad1 100644 --- a/compiler/rustc_ast_lowering/src/expr.rs +++ b/compiler/rustc_ast_lowering/src/expr.rs @@ -326,9 +326,8 @@ impl<'hir> LoweringContext<'_, 'hir> { args: Vec<AstP<Expr>>, legacy_args_idx: &[usize], ) -> hir::ExprKind<'hir> { - let path = match f.kind { - ExprKind::Path(None, ref mut path) => path, - _ => unreachable!(), + let ExprKind::Path(None, ref mut path) = f.kind else { + unreachable!(); }; // Split the arguments into const generics and normal arguments diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs index f48cf212a98..f3ed8314b3c 100644 --- a/compiler/rustc_ast_lowering/src/item.rs +++ b/compiler/rustc_ast_lowering/src/item.rs @@ -1331,9 +1331,8 @@ impl<'hir> LoweringContext<'_, 'hir> { // keep track of the Span info. Now, `add_implicitly_sized` in `AstConv` checks both param bounds and // where clauses for `?Sized`. for pred in &generics.where_clause.predicates { - let bound_pred = match *pred { - WherePredicate::BoundPredicate(ref bound_pred) => bound_pred, - _ => continue, + let WherePredicate::BoundPredicate(ref bound_pred) = *pred else { + continue; }; let compute_is_param = || { // Check if the where clause type is a plain type parameter. |
