diff --git a/compiler/rustc_trait_selection/src/traits/implied_outlives_bounds.rs b/compiler/rustc_trait_selection/src/traits/implied_outlives_bounds.rs index 79f630860235a..c0df53db4ab34 100644 --- a/compiler/rustc_trait_selection/src/traits/implied_outlives_bounds.rs +++ b/compiler/rustc_trait_selection/src/traits/implied_outlives_bounds.rs @@ -39,14 +39,6 @@ impl<'tcx> QueryTypeOp<'tcx> for ImpliedOutlivesBounds<'tcx> { ) -> Result, NoSolution> { tcx.implied_outlives_bounds((canonicalized, false)) } - - fn perform_locally_with_next_solver( - ocx: &ObligationCtxt<'_, 'tcx>, - key: ParamEnvAnd<'tcx, Self>, - _span: Span, - ) -> Result { - query_compute_implied_outlives_bounds(ocx, key.param_env, key.value.ty, false) - } } pub fn compute_implied_outlives_bounds_inner<'tcx>( diff --git a/compiler/rustc_trait_selection/src/traits/query/type_op/ascribe_user_type.rs b/compiler/rustc_trait_selection/src/traits/query/type_op/ascribe_user_type.rs index e8814c56c5016..239cbc5aa7622 100644 --- a/compiler/rustc_trait_selection/src/traits/query/type_op/ascribe_user_type.rs +++ b/compiler/rustc_trait_selection/src/traits/query/type_op/ascribe_user_type.rs @@ -29,14 +29,6 @@ impl<'tcx> super::QueryTypeOp<'tcx> for AscribeUserType<'tcx> { ) -> Result, NoSolution> { tcx.type_op_ascribe_user_type(canonicalized) } - - fn perform_locally_with_next_solver( - ocx: &ObligationCtxt<'_, 'tcx>, - key: ParamEnvAnd<'tcx, Self>, - span: Span, - ) -> Result { - type_op_ascribe_user_type_with_span(ocx, key, span) - } } /// The core of the `type_op_ascribe_user_type` query: for diagnostics purposes in NLL HRTB errors, diff --git a/compiler/rustc_trait_selection/src/traits/query/type_op/mod.rs b/compiler/rustc_trait_selection/src/traits/query/type_op/mod.rs index 62d636f2de046..250579a2b064a 100644 --- a/compiler/rustc_trait_selection/src/traits/query/type_op/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/query/type_op/mod.rs @@ -12,7 +12,7 @@ use crate::infer::canonical::{ QueryRegionConstraints, }; use crate::infer::{InferCtxt, InferOk}; -use crate::traits::{ObligationCause, ObligationCtxt}; +use crate::traits::ObligationCause; pub mod ascribe_user_type; pub mod custom; @@ -83,18 +83,6 @@ pub trait QueryTypeOp<'tcx>: fmt::Debug + Copy + TypeFoldable> + 't canonicalized: CanonicalQueryInput<'tcx, ParamEnvAnd<'tcx, Self>>, ) -> Result, NoSolution>; - /// In the new trait solver, we already do caching in the solver itself, - /// so there's no need to canonicalize and cache via the query system. - /// Additionally, even if we were to canonicalize, we'd still need to - /// make sure to feed it predefined opaque types and the defining anchor - /// and that would require duplicating all of the tcx queries. Instead, - /// just perform these ops locally. - fn perform_locally_with_next_solver( - ocx: &ObligationCtxt<'_, 'tcx>, - key: ParamEnvAnd<'tcx, Self>, - span: Span, - ) -> Result; - fn fully_perform_into( query_key: ParamEnvAnd<'tcx, Self>, infcx: &InferCtxt<'tcx>, diff --git a/compiler/rustc_trait_selection/src/traits/query/type_op/normalize.rs b/compiler/rustc_trait_selection/src/traits/query/type_op/normalize.rs index 7b330c942807c..66a2d44699634 100644 --- a/compiler/rustc_trait_selection/src/traits/query/type_op/normalize.rs +++ b/compiler/rustc_trait_selection/src/traits/query/type_op/normalize.rs @@ -1,13 +1,10 @@ use std::fmt; -use rustc_middle::traits::ObligationCause; use rustc_middle::traits::query::NoSolution; pub use rustc_middle::traits::query::type_op::Normalize; use rustc_middle::ty::{self, Lift, ParamEnvAnd, Ty, TyCtxt, TypeFoldable, TypeVisitableExt}; -use rustc_span::Span; use crate::infer::canonical::{CanonicalQueryInput, CanonicalQueryResponse}; -use crate::traits::ObligationCtxt; impl<'tcx, T> super::QueryTypeOp<'tcx> for Normalize<'tcx, T> where @@ -29,19 +26,6 @@ where ) -> Result, NoSolution> { T::type_op_method(tcx, canonicalized) } - - fn perform_locally_with_next_solver( - ocx: &ObligationCtxt<'_, 'tcx>, - key: ParamEnvAnd<'tcx, Self>, - span: Span, - ) -> Result { - ocx.deeply_normalize( - &ObligationCause::dummy_with_span(span), - key.param_env, - key.value.value, - ) - .map_err(|_| NoSolution) - } } pub trait Normalizable<'tcx>: diff --git a/compiler/rustc_trait_selection/src/traits/query/type_op/outlives.rs b/compiler/rustc_trait_selection/src/traits/query/type_op/outlives.rs index 99a2779aa8212..fd06dd4403c12 100644 --- a/compiler/rustc_trait_selection/src/traits/query/type_op/outlives.rs +++ b/compiler/rustc_trait_selection/src/traits/query/type_op/outlives.rs @@ -1,12 +1,8 @@ use rustc_middle::traits::query::{DropckOutlivesResult, NoSolution}; use rustc_middle::ty::{ParamEnvAnd, TyCtxt}; -use rustc_span::Span; use crate::infer::canonical::{CanonicalQueryInput, CanonicalQueryResponse}; -use crate::traits::ObligationCtxt; -use crate::traits::query::dropck_outlives::{ - compute_dropck_outlives_inner, trivial_dropck_outlives, -}; +use crate::traits::query::dropck_outlives::trivial_dropck_outlives; use crate::traits::query::type_op::DropckOutlives; impl<'tcx> super::QueryTypeOp<'tcx> for DropckOutlives<'tcx> { @@ -25,12 +21,4 @@ impl<'tcx> super::QueryTypeOp<'tcx> for DropckOutlives<'tcx> { ) -> Result, NoSolution> { tcx.dropck_outlives(canonicalized) } - - fn perform_locally_with_next_solver( - ocx: &ObligationCtxt<'_, 'tcx>, - key: ParamEnvAnd<'tcx, Self>, - span: Span, - ) -> Result { - compute_dropck_outlives_inner(ocx, key.param_env.and(key.value), span) - } } diff --git a/compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs b/compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs index 8601371c7ebf2..5dedd9af40561 100644 --- a/compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs +++ b/compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs @@ -3,7 +3,6 @@ use rustc_middle::traits::ObligationCause; use rustc_middle::traits::query::NoSolution; pub use rustc_middle::traits::query::type_op::ProvePredicate; use rustc_middle::ty::{self, ParamEnvAnd, TyCtxt}; -use rustc_span::Span; use crate::infer::canonical::{CanonicalQueryInput, CanonicalQueryResponse}; use crate::traits::{ObligationCtxt, sizedness_fast_path}; @@ -35,20 +34,6 @@ impl<'tcx> super::QueryTypeOp<'tcx> for ProvePredicate<'tcx> { ) -> Result, NoSolution> { tcx.type_op_prove_predicate(canonicalized) } - - fn perform_locally_with_next_solver( - ocx: &ObligationCtxt<'_, 'tcx>, - key: ParamEnvAnd<'tcx, Self>, - span: Span, - ) -> Result { - ocx.register_obligation(Obligation::new( - ocx.infcx.tcx, - ObligationCause::dummy_with_span(span), - key.param_env, - key.value.predicate, - )); - Ok(()) - } } /// The core of the `type_op_prove_predicate` query: for diagnostics purposes in NLL HRTB errors,