This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
compiler/rustc_borrowck/src/region_infer
tests/ui/type-alias-impl-trait Expand file tree Collapse file tree 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> {
278278 // HACK This bubble is required for this tests to pass:
279279 // nested-return-type2-tait2.rs
280280 // 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 ( ) ;
283293 let ocx = ObligationCtxt :: new ( & infcx) ;
284294 // Require the hidden type to be well-formed with only the generics of the opaque type.
285295 // 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
13// check-pass
24
35#![ feature( type_alias_impl_trait) ]
You can’t perform that action at this time.
0 commit comments