diff options
| author | lcnr <rust@lcnr.de> | 2023-09-29 11:34:50 +0200 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2023-09-29 11:34:50 +0200 |
| commit | a4f6770d83cb5aa82f10d8e8441ca5708600b077 (patch) | |
| tree | 89237755d0420af2b3e45abd78b24dff7da67567 /compiler/rustc_ty_utils | |
| parent | c1f86f0bc87eaa0cf16bcf3de38793096ec4db94 (diff) | |
| download | rust-a4f6770d83cb5aa82f10d8e8441ca5708600b077.tar.gz rust-a4f6770d83cb5aa82f10d8e8441ca5708600b077.zip | |
a small wf and clause cleanup
Diffstat (limited to 'compiler/rustc_ty_utils')
| -rw-r--r-- | compiler/rustc_ty_utils/src/ty.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_ty_utils/src/ty.rs b/compiler/rustc_ty_utils/src/ty.rs index 4234e69e854..c22c67bd907 100644 --- a/compiler/rustc_ty_utils/src/ty.rs +++ b/compiler/rustc_ty_utils/src/ty.rs @@ -3,9 +3,8 @@ use rustc_hir as hir; use rustc_hir::def::DefKind; use rustc_index::bit_set::BitSet; use rustc_middle::query::Providers; -use rustc_middle::ty::{ - self, EarlyBinder, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitor, -}; +use rustc_middle::ty::{self, EarlyBinder, Ty, TyCtxt, TypeVisitor}; +use rustc_middle::ty::{ToPredicate, TypeSuperVisitable, TypeVisitable}; use rustc_span::def_id::{DefId, LocalDefId, CRATE_DEF_ID}; use rustc_span::DUMMY_SP; use rustc_trait_selection::traits; @@ -214,10 +213,10 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for ImplTraitInTraitFinder<'_, 'tcx> { // strategy, then just reinterpret the associated type like an opaque :^) let default_ty = self.tcx.type_of(shifted_alias_ty.def_id).instantiate(self.tcx, shifted_alias_ty.args); - self.predicates.push(ty::Clause::from_projection_clause(self.tcx, ty::Binder::bind_with_vars( + self.predicates.push(ty::Binder::bind_with_vars( ty::ProjectionPredicate { projection_ty: shifted_alias_ty, term: default_ty.into() }, self.bound_vars, - ))); + ).to_predicate(self.tcx)); // We walk the *un-shifted* alias ty, because we're tracking the de bruijn // binder depth, and if we were to walk `shifted_alias_ty` instead, we'd |
