@@ -2,7 +2,7 @@ use rustc_hir as hir;
2
2
use rustc_hir:: def_id:: DefId ;
3
3
use rustc_infer:: infer:: at:: ToTrace ;
4
4
use rustc_infer:: infer:: canonical:: { Canonical , QueryResponse } ;
5
- use rustc_infer:: infer:: { InferCtxt , TyCtxtInferExt } ;
5
+ use rustc_infer:: infer:: { DefiningAnchor , InferCtxt , TyCtxtInferExt } ;
6
6
use rustc_infer:: traits:: TraitEngineExt as _;
7
7
use rustc_middle:: ty:: query:: Providers ;
8
8
use rustc_middle:: ty:: subst:: { GenericArg , Subst , UserSelfTy , UserSubsts } ;
@@ -258,10 +258,15 @@ fn type_op_prove_predicate<'tcx>(
258
258
tcx : TyCtxt < ' tcx > ,
259
259
canonicalized : Canonical < ' tcx , ParamEnvAnd < ' tcx , ProvePredicate < ' tcx > > > ,
260
260
) -> 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
+ // HACK This bubble is required for this test to pass:
262
+ // impl-trait/issue-99642.rs
263
+ tcx. infer_ctxt ( ) . with_opaque_type_inference ( DefiningAnchor :: Bubble ) . enter_canonical_trait_query (
264
+ & canonicalized,
265
+ |infcx, fulfill_cx, key| {
266
+ type_op_prove_predicate_with_cause ( infcx, fulfill_cx, key, ObligationCause :: dummy ( ) ) ;
267
+ Ok ( ( ) )
268
+ } ,
269
+ )
265
270
}
266
271
267
272
/// The core of the `type_op_prove_predicate` query: for diagnostics purposes in NLL HRTB errors,
0 commit comments