]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/hrtb/hrtb-exists-forall-fn.rs
1 // Test an `exists<'a> { forall<'b> { 'a = 'b } }` pattern -- which should not compile!
3 // In particular, we test this pattern in trait solving, where it is not connected
4 // to any part of the source code.
6 fn foo
<'a
>() -> fn(&'a
u32) {
11 // Here, proving that `fn(&'a u32) <: for<'b> fn(&'b u32)`:
13 // - instantiates `'b` with a placeholder `!b`,
14 // - requires that `&!b u32 <: &'a u32` and hence that `!b: 'a`,
15 // - but we can never know this.
17 let _
: for<'b
> fn(&'b
u32) = foo(); //~ ERROR mismatched types