-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
rust-lang/rust
#124827Labels
blocks-craterBlocks running a crater run for breakage w/ new solverBlocks running a crater run for breakage w/ new solver
Description
#![allow(unused)]
trait Trait<'a> {
type Assoc;
}
impl<'a> Trait<'a> for () {
type Assoc = ();
}
fn foo<T: for<'a> Trait<'a>>(x: T) -> for<'a> fn(<T as Trait<'a>>::Assoc) {
|_| ()
}
fn unconstrained<T>() -> T {
todo!()
}
fn main() {
// in universe 0
let mut x = unconstrained();
let bump: for<'a, 'b> fn(&'a (), &'b ()) = |_, _| ();
let _: for<'a> fn(&'a (), &'a ()) = bump;
// in universe 1
let mut y = Default::default();
// ?x.0 :> for<'a> fn(<?y.1 as Trait<'a>>::Assoc) ~>
// ?x.0 instantiated for<'a> fn(<?x'.0 as Trait<'a>>::Assoc)
x = foo(y);
// for<'a> fn(<?x'.0 as Trait<'a>>::Assoc) :> <() as Trait<'a>>::Assoc stays ambig
let _: () = y;
}
Metadata
Metadata
Assignees
Labels
blocks-craterBlocks running a crater run for breakage w/ new solverBlocks running a crater run for breakage w/ new solver