-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
opaque types + leak check is somewaht tragic
struct SendIfEq<'a, 'b>(Option<*mut (&'a (), &'b ())>);
unsafe impl<'a> Send for SendIfEq<'a, 'a> {}
trait Trait<'a, 'hr> {}
impl<'a, 'hr, F, R> Trait<'a, 'hr> for F
where
F: FnOnce(&'a (), &'hr ()) -> R,
R: Send,
{}
trait HigherRanked<'a, T> {}
impl<'a, F: for<'hr> Trait<'a, 'hr>> HigherRanked<'a, u32> for F {}
impl<'a, F> HigherRanked<'a, i32> for F {}
fn check_bound<'a, T>(_: impl HigherRanked<'a, T>) -> T { todo!() }
fn different<'a, 'b>(_: &'a (), _: &'b ()) -> impl Sized {
SendIfEq::<'a, 'b>(None)
}
fn equal<'a, 'b>(_: &'a (), _: &'b ()) -> impl Sized {
SendIfEq::<'a, 'a>(None)
}
fn ok() {
check_bound(different);
}
fn ambig() {
check_bound(equal);
}fn ok currently compiles with -Znext-solver while ambig never does. I think that's because the leak check in evaluate is quite jank and we don't return constraints from nested trait goals.
Nadrieril
Metadata
Metadata
Assignees
Labels
No labels