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_borrowck | |
| parent | 97bf25c8cf6c7c97c851c6e8bc94fd0824885e6f (diff) | |
| download | rust-11ec3eca740d128eee15c40f930c4d13d72be7dd.tar.gz rust-11ec3eca740d128eee15c40f930c4d13d72be7dd.zip | |
Rename ToPredicate for Upcast
Diffstat (limited to 'compiler/rustc_borrowck')
4 files changed, 10 insertions, 10 deletions
diff --git a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs index ccc45e2829a..15050c87b39 100644 --- a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs @@ -24,8 +24,8 @@ use rustc_middle::mir::{ }; use rustc_middle::ty::print::PrintTraitRefExt as _; use rustc_middle::ty::{ - self, suggest_constraining_type_params, PredicateKind, ToPredicate, Ty, TyCtxt, - TypeSuperVisitable, TypeVisitor, + self, suggest_constraining_type_params, PredicateKind, Ty, TyCtxt, TypeSuperVisitable, + TypeVisitor, Upcast, }; use rustc_middle::util::CallKind; use rustc_mir_dataflow::move_paths::{InitKind, MoveOutIndex, MovePathIndex}; @@ -1915,7 +1915,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { self.infcx.err_ctxt().suggest_derive( &obligation, err, - trait_ref.to_predicate(self.infcx.tcx), + trait_ref.upcast(self.infcx.tcx), ); } } diff --git a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs index c9a09c19ce6..35017b9e6b5 100644 --- a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs @@ -9,7 +9,7 @@ use rustc_hir::{self as hir, BindingMode, ByRef, Node}; use rustc_infer::traits; use rustc_middle::bug; use rustc_middle::mir::{Mutability, Place, PlaceRef, ProjectionElem}; -use rustc_middle::ty::{self, InstanceDef, ToPredicate, Ty, TyCtxt}; +use rustc_middle::ty::{self, InstanceDef, Ty, TyCtxt, Upcast}; use rustc_middle::{ hir::place::PlaceBase, mir::{self, BindingForm, Local, LocalDecl, LocalInfo, LocalKind, Location}, @@ -1255,7 +1255,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { self.infcx.err_ctxt().suggest_derive( &obligation, err, - trait_ref.to_predicate(self.infcx.tcx), + trait_ref.upcast(self.infcx.tcx), ); } Some(errors) => { diff --git a/compiler/rustc_borrowck/src/type_check/canonical.rs b/compiler/rustc_borrowck/src/type_check/canonical.rs index 49d3f7381d9..2b89fa9b770 100644 --- a/compiler/rustc_borrowck/src/type_check/canonical.rs +++ b/compiler/rustc_borrowck/src/type_check/canonical.rs @@ -4,7 +4,7 @@ use rustc_errors::ErrorGuaranteed; use rustc_infer::infer::canonical::Canonical; use rustc_middle::bug; use rustc_middle::mir::ConstraintCategory; -use rustc_middle::ty::{self, ToPredicate, Ty, TyCtxt, TypeFoldable}; +use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable, Upcast}; use rustc_span::def_id::DefId; use rustc_span::Span; use rustc_trait_selection::traits::query::type_op::{self, TypeOpOutput}; @@ -115,7 +115,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { pub(super) fn prove_predicates( &mut self, - predicates: impl IntoIterator<Item: ToPredicate<'tcx> + std::fmt::Debug>, + predicates: impl IntoIterator<Item: Upcast<'tcx> + std::fmt::Debug>, locations: Locations, category: ConstraintCategory<'tcx>, ) { @@ -127,12 +127,12 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { #[instrument(skip(self), level = "debug")] pub(super) fn prove_predicate( &mut self, - predicate: impl ToPredicate<'tcx> + std::fmt::Debug, + predicate: impl Upcast<'tcx> + std::fmt::Debug, locations: Locations, category: ConstraintCategory<'tcx>, ) { let param_env = self.param_env; - let predicate = predicate.to_predicate(self.tcx()); + let predicate = predicate.upcast(self.tcx()); let _: Result<_, ErrorGuaranteed> = self.fully_perform_op( locations, category, diff --git a/compiler/rustc_borrowck/src/type_check/relate_tys.rs b/compiler/rustc_borrowck/src/type_check/relate_tys.rs index 493c41e59e3..2b01b8dbbf4 100644 --- a/compiler/rustc_borrowck/src/type_check/relate_tys.rs +++ b/compiler/rustc_borrowck/src/type_check/relate_tys.rs @@ -546,7 +546,7 @@ impl<'bccx, 'tcx> ObligationEmittingRelation<'tcx> for NllTypeRelating<'_, 'bccx self.type_checker.param_env } - fn register_predicates(&mut self, obligations: impl IntoIterator<Item: ty::ToPredicate<'tcx>>) { + fn register_predicates(&mut self, obligations: impl IntoIterator<Item: ty::Upcast<'tcx>>) { self.register_obligations( obligations .into_iter() |
