]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_borrowck/src/diagnostics/region_errors.rs
Auto merge of #105233 - mejrs:always_eager, r=estebank
[rust.git] / compiler / rustc_borrowck / src / diagnostics / region_errors.rs
index 7aa099433a76d902145decf600c3fac97be5ded7..e6520301818d82beb2bb99c754fa3b6f7eedf945 100644 (file)
@@ -504,7 +504,7 @@ fn report_fnmut_error(
         let ErrorConstraintInfo { outlived_fr, span, .. } = errci;
 
         let mut output_ty = self.regioncx.universal_regions().unnormalized_output_ty;
-        if let ty::Opaque(def_id, _) = *output_ty.kind() {
+        if let ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs: _ }) = *output_ty.kind() {
             output_ty = self.infcx.tcx.type_of(def_id)
         };
 
@@ -921,7 +921,7 @@ fn suggest_move_on_borrowing_closure(&self, diag: &mut Diagnostic) {
                 }
             }
             hir::ExprKind::Block(blk, _) => {
-                if let Some(ref expr) = blk.expr {
+                if let Some(expr) = blk.expr {
                     // only when the block is a closure
                     if let hir::ExprKind::Closure(hir::Closure {
                         capture_clause: hir::CaptureBy::Ref,