mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 00:03:43 +00:00
22 lines
381 B
Rust
22 lines
381 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 `<() as Array<'a>>::Element == ()`
|
|
}
|