diff options
| author | Michael Goulet <michael@errs.io> | 2023-05-31 01:21:38 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-06-06 18:43:20 +0000 |
| commit | 3d4da98273553b2307d8ce3a03c476e459aa3f45 (patch) | |
| tree | f0728e73270bdf03a3c42bc2c9d54484feeae711 /compiler/rustc_hir_analysis/src | |
| parent | b637048a89654d105a17b6b6f1a060fd8dcfd093 (diff) | |
| download | rust-3d4da98273553b2307d8ce3a03c476e459aa3f45.tar.gz rust-3d4da98273553b2307d8ce3a03c476e459aa3f45.zip | |
Make TraitEngine::new use the right solver, add compare mode
Diffstat (limited to 'compiler/rustc_hir_analysis/src')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/autoderef.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_hir_analysis/src/check/check.rs | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_hir_analysis/src/autoderef.rs b/compiler/rustc_hir_analysis/src/autoderef.rs index f624118a4f1..6eb18aecd65 100644 --- a/compiler/rustc_hir_analysis/src/autoderef.rs +++ b/compiler/rustc_hir_analysis/src/autoderef.rs @@ -161,8 +161,7 @@ impl<'a, 'tcx> Autoderef<'a, 'tcx> { &self, ty: Ty<'tcx>, ) -> Option<(Ty<'tcx>, Vec<traits::PredicateObligation<'tcx>>)> { - let tcx = self.infcx.tcx; - let mut fulfill_cx = <dyn TraitEngine<'tcx>>::new_in_snapshot(tcx); + let mut fulfill_cx = <dyn TraitEngine<'tcx>>::new_in_snapshot(self.infcx); let cause = traits::ObligationCause::misc(self.span, self.body_id); let normalized_ty = match self diff --git a/compiler/rustc_hir_analysis/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs index 4a1f8ece7b2..17be5fe66cf 100644 --- a/compiler/rustc_hir_analysis/src/check/check.rs +++ b/compiler/rustc_hir_analysis/src/check/check.rs @@ -1549,7 +1549,7 @@ pub(super) fn check_generator_obligations(tcx: TyCtxt<'_>, def_id: LocalDefId) { .with_opaque_type_inference(DefiningAnchor::Bind(def_id)) .build(); - let mut fulfillment_cx = <dyn TraitEngine<'_>>::new(infcx.tcx); + let mut fulfillment_cx = <dyn TraitEngine<'_>>::new(&infcx); for (predicate, cause) in generator_interior_predicates { let obligation = Obligation::new(tcx, cause.clone(), param_env, *predicate); fulfillment_cx.register_predicate_obligation(&infcx, obligation); |
