mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Rollup merge of #112963 - oli-obk:tait_solver_decoupling, r=compiler-errors
Stop bubbling out hidden types from the eval obligation queries r? `@compiler-errors` I don't know why these were added, but they are not needed anymore. The relevant test is unaffected and I didn't see anything interesting in logging that would have justified it. This PR has no effect on the new solver behaviour ofcf2dff2b1e/tests/ui/impl-trait/issue-99642.rs
(which is overflow) andcf2dff2b1e/tests/ui/impl-trait/issue-99642-2.rs
(which is "unstable certainty ICE")
This commit is contained in:
commit
fdce450eb5
@ -1,6 +1,5 @@
|
|||||||
use rustc_infer::infer::TyCtxtInferExt;
|
use rustc_infer::infer::TyCtxtInferExt;
|
||||||
use rustc_middle::query::Providers;
|
use rustc_middle::query::Providers;
|
||||||
use rustc_middle::traits::DefiningAnchor;
|
|
||||||
use rustc_middle::ty::{ParamEnvAnd, TyCtxt};
|
use rustc_middle::ty::{ParamEnvAnd, TyCtxt};
|
||||||
use rustc_span::source_map::DUMMY_SP;
|
use rustc_span::source_map::DUMMY_SP;
|
||||||
use rustc_trait_selection::traits::query::CanonicalPredicateGoal;
|
use rustc_trait_selection::traits::query::CanonicalPredicateGoal;
|
||||||
@ -18,12 +17,8 @@ fn evaluate_obligation<'tcx>(
|
|||||||
) -> Result<EvaluationResult, OverflowError> {
|
) -> Result<EvaluationResult, OverflowError> {
|
||||||
assert!(!tcx.next_trait_solver_globally());
|
assert!(!tcx.next_trait_solver_globally());
|
||||||
debug!("evaluate_obligation(canonical_goal={:#?})", canonical_goal);
|
debug!("evaluate_obligation(canonical_goal={:#?})", canonical_goal);
|
||||||
// HACK This bubble is required for this tests to pass:
|
let (ref infcx, goal, _canonical_inference_vars) =
|
||||||
// impl-trait/issue99642.rs
|
tcx.infer_ctxt().build_with_canonical(DUMMY_SP, &canonical_goal);
|
||||||
let (ref infcx, goal, _canonical_inference_vars) = tcx
|
|
||||||
.infer_ctxt()
|
|
||||||
.with_opaque_type_inference(DefiningAnchor::Bubble)
|
|
||||||
.build_with_canonical(DUMMY_SP, &canonical_goal);
|
|
||||||
debug!("evaluate_obligation: goal={:#?}", goal);
|
debug!("evaluate_obligation: goal={:#?}", goal);
|
||||||
let ParamEnvAnd { param_env, value: predicate } = goal;
|
let ParamEnvAnd { param_env, value: predicate } = goal;
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ use rustc_infer::infer::canonical::{Canonical, QueryResponse};
|
|||||||
use rustc_infer::infer::TyCtxtInferExt;
|
use rustc_infer::infer::TyCtxtInferExt;
|
||||||
use rustc_middle::query::Providers;
|
use rustc_middle::query::Providers;
|
||||||
use rustc_middle::traits::query::NoSolution;
|
use rustc_middle::traits::query::NoSolution;
|
||||||
use rustc_middle::traits::DefiningAnchor;
|
|
||||||
use rustc_middle::ty::{FnSig, Lift, PolyFnSig, Ty, TyCtxt, TypeFoldable};
|
use rustc_middle::ty::{FnSig, Lift, PolyFnSig, Ty, TyCtxt, TypeFoldable};
|
||||||
use rustc_middle::ty::{ParamEnvAnd, Predicate};
|
use rustc_middle::ty::{ParamEnvAnd, Predicate};
|
||||||
use rustc_trait_selection::infer::InferCtxtBuilderExt;
|
use rustc_trait_selection::infer::InferCtxtBuilderExt;
|
||||||
@ -106,15 +105,10 @@ fn type_op_prove_predicate<'tcx>(
|
|||||||
tcx: TyCtxt<'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
canonicalized: Canonical<'tcx, ParamEnvAnd<'tcx, ProvePredicate<'tcx>>>,
|
canonicalized: Canonical<'tcx, ParamEnvAnd<'tcx, ProvePredicate<'tcx>>>,
|
||||||
) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, ()>>, NoSolution> {
|
) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, ()>>, NoSolution> {
|
||||||
// HACK This bubble is required for this test to pass:
|
tcx.infer_ctxt().enter_canonical_trait_query(&canonicalized, |ocx, key| {
|
||||||
// impl-trait/issue-99642.rs
|
|
||||||
tcx.infer_ctxt().with_opaque_type_inference(DefiningAnchor::Bubble).enter_canonical_trait_query(
|
|
||||||
&canonicalized,
|
|
||||||
|ocx, key| {
|
|
||||||
type_op_prove_predicate_with_cause(ocx, key, ObligationCause::dummy());
|
type_op_prove_predicate_with_cause(ocx, key, ObligationCause::dummy());
|
||||||
Ok(())
|
Ok(())
|
||||||
},
|
})
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The core of the `type_op_prove_predicate` query: for diagnostics purposes in NLL HRTB errors,
|
/// The core of the `type_op_prove_predicate` query: for diagnostics purposes in NLL HRTB errors,
|
||||||
|
Loading…
Reference in New Issue
Block a user