diff options
| author | Michael Goulet <michael@errs.io> | 2024-06-07 11:51:03 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-06-11 14:10:11 -0400 |
| commit | e4be97cfe763fc5550e048ae3db288fd27a1954c (patch) | |
| tree | f9434088541e625b54540833adbb79ebcee20381 /compiler/rustc_infer/src/infer/projection.rs | |
| parent | 4efb13b0c24363daf63be0ce98ab612a42fbff30 (diff) | |
| download | rust-e4be97cfe763fc5550e048ae3db288fd27a1954c.tar.gz rust-e4be97cfe763fc5550e048ae3db288fd27a1954c.zip | |
Try not to make obligations in handle_opaque_type
Diffstat (limited to 'compiler/rustc_infer/src/infer/projection.rs')
| -rw-r--r-- | compiler/rustc_infer/src/infer/projection.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rustc_infer/src/infer/projection.rs b/compiler/rustc_infer/src/infer/projection.rs index 16786347980..a1ba43eb171 100644 --- a/compiler/rustc_infer/src/infer/projection.rs +++ b/compiler/rustc_infer/src/infer/projection.rs @@ -21,11 +21,12 @@ impl<'tcx> InferCtxt<'tcx> { obligations: &mut Vec<PredicateObligation<'tcx>>, ) -> Ty<'tcx> { debug_assert!(!self.next_trait_solver()); - let def_id = projection_ty.def_id; - let ty_var = self.next_ty_var(self.tcx.def_span(def_id)); - let projection = ty::Binder::dummy(ty::PredicateKind::Clause(ty::ClauseKind::Projection( - ty::ProjectionPredicate { projection_term: projection_ty.into(), term: ty_var.into() }, - ))); + let ty_var = self.next_ty_var(self.tcx.def_span(projection_ty.def_id)); + let projection = + ty::PredicateKind::Clause(ty::ClauseKind::Projection(ty::ProjectionPredicate { + projection_term: projection_ty.into(), + term: ty_var.into(), + })); let obligation = Obligation::with_depth(self.tcx, cause, recursion_depth, param_env, projection); obligations.push(obligation); |
