1 // Test that impls for these two types are considered ovelapping:
3 // * `for<'r> fn(fn(&'r u32))`
4 // * `fn(fn(&'a u32)` where `'a` is free
6 // This is because, for `'a = 'static`, the two types overlap.
7 // Effectively for them to be equal to you get:
9 // * `for<'r> fn(fn(&'r u32)) <: fn(fn(&'static u32))`
10 // * true if `exists<'r> { 'r: 'static }` (obviously true)
11 // * `fn(fn(&'static u32)) <: for<'r> fn(fn(&'r u32))`
12 // * true if `forall<'r> { 'static: 'r }` (also true)
16 impl Trait for for<'r> fn(fn(&'r ())) {}
17 impl<'a> Trait for fn(fn(&'a ())) {}
18 //~^ ERROR conflicting implementations
20 // Note in particular that we do NOT get a future-compatibility warning
21 // here. This is because the new leak-check proposed in [MCP 295] does not
22 // "error" when these two types are equated.
24 // [MCP 295]: https://github.com/rust-lang/compiler-team/issues/295