diff options
| author | Michael Goulet <michael@errs.io> | 2024-05-15 10:05:25 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-05-16 14:23:47 -0400 |
| commit | 11ec3eca740d128eee15c40f930c4d13d72be7dd (patch) | |
| tree | 5a504a05011ac96618088805bc6ddf97abb6bc48 /compiler/rustc_middle/src/traits | |
| parent | 97bf25c8cf6c7c97c851c6e8bc94fd0824885e6f (diff) | |
| download | rust-11ec3eca740d128eee15c40f930c4d13d72be7dd.tar.gz rust-11ec3eca740d128eee15c40f930c4d13d72be7dd.zip | |
Rename ToPredicate for Upcast
Diffstat (limited to 'compiler/rustc_middle/src/traits')
| -rw-r--r-- | compiler/rustc_middle/src/traits/solve.rs | 12 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/traits/util.rs | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/compiler/rustc_middle/src/traits/solve.rs b/compiler/rustc_middle/src/traits/solve.rs index 3ad6b68d129..fe9a4c0f677 100644 --- a/compiler/rustc_middle/src/traits/solve.rs +++ b/compiler/rustc_middle/src/traits/solve.rs @@ -7,8 +7,8 @@ use crate::infer::canonical::{CanonicalVarValues, QueryRegionConstraints}; use crate::traits::query::NoSolution; use crate::traits::Canonical; use crate::ty::{ - self, FallibleTypeFolder, ToPredicate, Ty, TyCtxt, TypeFoldable, TypeFolder, TypeVisitable, - TypeVisitor, + self, FallibleTypeFolder, Ty, TyCtxt, TypeFoldable, TypeFolder, TypeVisitable, TypeVisitor, + Upcast, }; use super::BuiltinImplSource; @@ -33,14 +33,14 @@ impl<'tcx, P> Goal<'tcx, P> { pub fn new( tcx: TyCtxt<'tcx>, param_env: ty::ParamEnv<'tcx>, - predicate: impl ToPredicate<'tcx, P>, + predicate: impl Upcast<'tcx, P>, ) -> Goal<'tcx, P> { - Goal { param_env, predicate: predicate.to_predicate(tcx) } + Goal { param_env, predicate: predicate.upcast(tcx) } } /// Updates the goal to one with a different `predicate` but the same `param_env`. - pub fn with<Q>(self, tcx: TyCtxt<'tcx>, predicate: impl ToPredicate<'tcx, Q>) -> Goal<'tcx, Q> { - Goal { param_env: self.param_env, predicate: predicate.to_predicate(tcx) } + pub fn with<Q>(self, tcx: TyCtxt<'tcx>, predicate: impl Upcast<'tcx, Q>) -> Goal<'tcx, Q> { + Goal { param_env: self.param_env, predicate: predicate.upcast(tcx) } } } diff --git a/compiler/rustc_middle/src/traits/util.rs b/compiler/rustc_middle/src/traits/util.rs index 3419827a742..707e076921b 100644 --- a/compiler/rustc_middle/src/traits/util.rs +++ b/compiler/rustc_middle/src/traits/util.rs @@ -1,6 +1,6 @@ use rustc_data_structures::fx::FxHashSet; -use crate::ty::{Clause, PolyTraitRef, ToPolyTraitRef, ToPredicate, TyCtxt}; +use crate::ty::{Clause, PolyTraitRef, ToPolyTraitRef, TyCtxt, Upcast}; /// Given a [`PolyTraitRef`], get the [`Clause`]s implied by the trait's definition. /// @@ -11,7 +11,7 @@ pub fn super_predicates_for_pretty_printing<'tcx>( tcx: TyCtxt<'tcx>, trait_ref: PolyTraitRef<'tcx>, ) -> impl Iterator<Item = Clause<'tcx>> { - let clause = trait_ref.to_predicate(tcx); + let clause = trait_ref.upcast(tcx); Elaborator { tcx, visited: FxHashSet::from_iter([clause]), stack: vec![clause] } } |
