rust/tests/ui/issues/issue-39970.rs
2023-01-11 09:32:08 +00:00

22 lines
389 B
Rust

trait Array<'a> {
type Element: 'a;
}
trait Visit {
fn visit() {}
}
impl<'a> Array<'a> for () {
type Element = &'a ();
}
impl Visit for () where
//(): for<'a> Array<'a, Element=&'a ()>, // No ICE
(): for<'a> Array<'a, Element=()>, // ICE
{}
fn main() {
<() as Visit>::visit();
//~^ ERROR type mismatch resolving `for<'a> <() as Array<'a>>::Element == ()`
}