@@ -2,7 +2,7 @@ use rustc_hir as hir;
22use rustc_hir:: def_id:: DefId ;
33use rustc_infer:: infer:: at:: ToTrace ;
44use rustc_infer:: infer:: canonical:: { Canonical , QueryResponse } ;
5- use rustc_infer:: infer:: { InferCtxt , TyCtxtInferExt } ;
5+ use rustc_infer:: infer:: { DefiningAnchor , InferCtxt , TyCtxtInferExt } ;
66use rustc_infer:: traits:: TraitEngineExt as _;
77use rustc_middle:: ty:: query:: Providers ;
88use rustc_middle:: ty:: subst:: { GenericArg , Subst , UserSelfTy , UserSubsts } ;
@@ -258,10 +258,13 @@ fn type_op_prove_predicate<'tcx>(
258258 tcx : TyCtxt < ' tcx > ,
259259 canonicalized : Canonical < ' tcx , ParamEnvAnd < ' tcx , ProvePredicate < ' tcx > > > ,
260260) -> Result < & ' tcx Canonical < ' tcx , QueryResponse < ' tcx , ( ) > > , NoSolution > {
261- tcx. infer_ctxt ( ) . enter_canonical_trait_query ( & canonicalized, |infcx, fulfill_cx, key| {
262- type_op_prove_predicate_with_cause ( infcx, fulfill_cx, key, ObligationCause :: dummy ( ) ) ;
263- Ok ( ( ) )
264- } )
261+ tcx. infer_ctxt ( ) . with_opaque_type_inference ( DefiningAnchor :: Bubble ) . enter_canonical_trait_query (
262+ & canonicalized,
263+ |infcx, fulfill_cx, key| {
264+ type_op_prove_predicate_with_cause ( infcx, fulfill_cx, key, ObligationCause :: dummy ( ) ) ;
265+ Ok ( ( ) )
266+ } ,
267+ )
265268}
266269
267270/// The core of the `type_op_prove_predicate` query: for diagnostics purposes in NLL HRTB errors,
0 commit comments