Use DefiningAnchor::Bind in infer_opaque_definition_from_instantiation
This commit is contained in:
parent
917b0b6c70
commit
a810b584cf
2 changed files with 14 additions and 2 deletions
|
@ -278,8 +278,18 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
|
||||||
// HACK This bubble is required for this tests to pass:
|
// HACK This bubble is required for this tests to pass:
|
||||||
// nested-return-type2-tait2.rs
|
// nested-return-type2-tait2.rs
|
||||||
// nested-return-type2-tait3.rs
|
// nested-return-type2-tait3.rs
|
||||||
let infcx =
|
// FIXME(-Ztrait-solver=next): We probably should use `DefiningAnchor::Error`
|
||||||
self.tcx.infer_ctxt().with_opaque_type_inference(DefiningAnchor::Bubble).build();
|
// and prepopulate this `InferCtxt` with known opaque values, rather than
|
||||||
|
// using the `Bind` anchor here. For now it's fine.
|
||||||
|
let infcx = self
|
||||||
|
.tcx
|
||||||
|
.infer_ctxt()
|
||||||
|
.with_opaque_type_inference(if self.tcx.trait_solver_next() {
|
||||||
|
DefiningAnchor::Bind(def_id)
|
||||||
|
} else {
|
||||||
|
DefiningAnchor::Bubble
|
||||||
|
})
|
||||||
|
.build();
|
||||||
let ocx = ObligationCtxt::new(&infcx);
|
let ocx = ObligationCtxt::new(&infcx);
|
||||||
// Require the hidden type to be well-formed with only the generics of the opaque type.
|
// Require the hidden type to be well-formed with only the generics of the opaque type.
|
||||||
// Defining use functions may have more bounds than the opaque type, which is ok, as long as the
|
// Defining use functions may have more bounds than the opaque type, which is ok, as long as the
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// revisions: current next
|
||||||
|
//[next] compile-flags: -Ztrait-solver=next
|
||||||
// check-pass
|
// check-pass
|
||||||
|
|
||||||
#![feature(type_alias_impl_trait)]
|
#![feature(type_alias_impl_trait)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue