Bubble up obligations
This commit is contained in:
parent
64dc377a10
commit
4a0473c0f5
3 changed files with 13 additions and 8 deletions
|
@ -1,4 +1,4 @@
|
|||
use rustc_infer::infer::TyCtxtInferExt;
|
||||
use rustc_infer::infer::{DefiningAnchor, TyCtxtInferExt};
|
||||
use rustc_middle::ty::query::Providers;
|
||||
use rustc_middle::ty::{ParamEnvAnd, TyCtxt};
|
||||
use rustc_span::source_map::DUMMY_SP;
|
||||
|
@ -16,7 +16,7 @@ fn evaluate_obligation<'tcx>(
|
|||
canonical_goal: CanonicalPredicateGoal<'tcx>,
|
||||
) -> Result<EvaluationResult, OverflowError> {
|
||||
debug!("evaluate_obligation(canonical_goal={:#?})", canonical_goal);
|
||||
tcx.infer_ctxt().enter_with_canonical(
|
||||
tcx.infer_ctxt().with_opaque_type_inference(DefiningAnchor::Bubble).enter_with_canonical(
|
||||
DUMMY_SP,
|
||||
&canonical_goal,
|
||||
|ref infcx, goal, _canonical_inference_vars| {
|
||||
|
|
|
@ -2,7 +2,7 @@ use rustc_hir as hir;
|
|||
use rustc_hir::def_id::DefId;
|
||||
use rustc_infer::infer::at::ToTrace;
|
||||
use rustc_infer::infer::canonical::{Canonical, QueryResponse};
|
||||
use rustc_infer::infer::{InferCtxt, TyCtxtInferExt};
|
||||
use rustc_infer::infer::{DefiningAnchor, InferCtxt, TyCtxtInferExt};
|
||||
use rustc_infer::traits::TraitEngineExt as _;
|
||||
use rustc_middle::ty::query::Providers;
|
||||
use rustc_middle::ty::subst::{GenericArg, Subst, UserSelfTy, UserSubsts};
|
||||
|
@ -258,10 +258,13 @@ fn type_op_prove_predicate<'tcx>(
|
|||
tcx: TyCtxt<'tcx>,
|
||||
canonicalized: Canonical<'tcx, ParamEnvAnd<'tcx, ProvePredicate<'tcx>>>,
|
||||
) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, ()>>, NoSolution> {
|
||||
tcx.infer_ctxt().enter_canonical_trait_query(&canonicalized, |infcx, fulfill_cx, key| {
|
||||
type_op_prove_predicate_with_cause(infcx, fulfill_cx, key, ObligationCause::dummy());
|
||||
Ok(())
|
||||
})
|
||||
tcx.infer_ctxt().with_opaque_type_inference(DefiningAnchor::Bubble).enter_canonical_trait_query(
|
||||
&canonicalized,
|
||||
|infcx, fulfill_cx, key| {
|
||||
type_op_prove_predicate_with_cause(infcx, fulfill_cx, key, ObligationCause::dummy());
|
||||
Ok(())
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
/// The core of the `type_op_prove_predicate` query: for diagnostics purposes in NLL HRTB errors,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue