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/solve.rs | |
| parent | 97bf25c8cf6c7c97c851c6e8bc94fd0824885e6f (diff) | |
| download | rust-11ec3eca740d128eee15c40f930c4d13d72be7dd.tar.gz rust-11ec3eca740d128eee15c40f930c4d13d72be7dd.zip | |
Rename ToPredicate for Upcast
Diffstat (limited to 'compiler/rustc_middle/src/traits/solve.rs')
| -rw-r--r-- | compiler/rustc_middle/src/traits/solve.rs | 12 | 
1 files changed, 6 insertions, 6 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) } } } | 
