File tree 2 files changed +14
-2
lines changed
compiler/rustc_borrowck/src/region_infer
tests/ui/type-alias-impl-trait
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -278,8 +278,18 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
278
278
// HACK This bubble is required for this tests to pass:
279
279
// nested-return-type2-tait2.rs
280
280
// nested-return-type2-tait3.rs
281
- let infcx =
282
- self . tcx . infer_ctxt ( ) . with_opaque_type_inference ( DefiningAnchor :: Bubble ) . build ( ) ;
281
+ // FIXME(-Ztrait-solver=next): We probably should use `DefiningAnchor::Error`
282
+ // and prepopulate this `InferCtxt` with known opaque values, rather than
283
+ // using the `Bind` anchor here. For now it's fine.
284
+ let infcx = self
285
+ . tcx
286
+ . infer_ctxt ( )
287
+ . with_opaque_type_inference ( if self . tcx . trait_solver_next ( ) {
288
+ DefiningAnchor :: Bind ( def_id)
289
+ } else {
290
+ DefiningAnchor :: Bubble
291
+ } )
292
+ . build ( ) ;
283
293
let ocx = ObligationCtxt :: new ( & infcx) ;
284
294
// Require the hidden type to be well-formed with only the generics of the opaque type.
285
295
// Defining use functions may have more bounds than the opaque type, which is ok, as long as the
Original file line number Diff line number Diff line change
1
+ // revisions: current next
2
+ //[next] compile-flags: -Ztrait-solver=next
1
3
// check-pass
2
4
3
5
#![ feature( type_alias_impl_trait) ]
You can’t perform that action at this time.
0 commit comments