diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2022-12-26 13:35:35 -0800 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2022-12-26 13:35:35 -0800 |
| commit | 8a13a7c14874147621e5344e3f31aaed39d390f5 (patch) | |
| tree | d22a16a3c12b5bebba16ad0ec261eff0152a04f3 /compiler | |
| parent | bd890f9cd1e06b5b8c635db2def235373290b09d (diff) | |
| download | rust-8a13a7c14874147621e5344e3f31aaed39d390f5.tar.gz rust-8a13a7c14874147621e5344e3f31aaed39d390f5.zip | |
review comments
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_borrowck/src/diagnostics/mod.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/compiler/rustc_borrowck/src/diagnostics/mod.rs b/compiler/rustc_borrowck/src/diagnostics/mod.rs index 6b5c1d1a20f..63b16aa95a6 100644 --- a/compiler/rustc_borrowck/src/diagnostics/mod.rs +++ b/compiler/rustc_borrowck/src/diagnostics/mod.rs @@ -1135,16 +1135,14 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { ), ); let infcx = tcx.infer_ctxt().build(); - let ty = infcx.freshen(moved_place.ty(self.body, tcx).ty); + let ty = tcx.erase_regions(moved_place.ty(self.body, tcx).ty); if let ty::Adt(def, substs) = ty.kind() && Some(def.did()) == tcx.lang_items().pin_type() && let ty::Ref(_, _, hir::Mutability::Mut) = substs.type_at(0).kind() - && let self_ty = infcx.freshen( - infcx.replace_bound_vars_with_fresh_vars( - fn_call_span, - LateBoundRegionConversionTime::FnCall, - tcx.fn_sig(method_did).input(0), - ) + && let self_ty = infcx.replace_bound_vars_with_fresh_vars( + fn_call_span, + LateBoundRegionConversionTime::FnCall, + tcx.fn_sig(method_did).input(0), ) && infcx.can_eq(self.param_env, ty, self_ty).is_ok() { |
