]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_typeck/src/check/expr.rs
Auto merge of #94105 - 5225225:destabilise-entry-insert, r=Mark-Simulacrum
[rust.git] / compiler / rustc_typeck / src / check / expr.rs
index b5f13703edfbe9930b2f79a6a98be3289108e20d..4869d193d8056863059ef02d0abf4309fa15676d 100644 (file)
@@ -1318,10 +1318,7 @@ fn check_expr_struct(
         base_expr: &'tcx Option<&'tcx hir::Expr<'tcx>>,
     ) -> Ty<'tcx> {
         // Find the relevant variant
-        let (variant, adt_ty) = if let Some(variant_ty) = self.check_struct_path(qpath, expr.hir_id)
-        {
-            variant_ty
-        } else {
+        let Some((variant, adt_ty)) = self.check_struct_path(qpath, expr.hir_id) else {
             self.check_struct_fields_on_error(fields, base_expr);
             return self.tcx.ty_error();
         };