]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/closure-malformed-projection-input-issue-102800.rs
Rollup merge of #105216 - GuillaumeGomez:rm-unused-gui-test, r=notriddle
[rust.git] / src / test / ui / nll / closure-malformed-projection-input-issue-102800.rs
1 // Regression test for #102800
2 //
3 // Here we are generating higher-ranked region constraints when normalizing and relating closure
4 // input types. Previously this was an ICE in the error path because we didn't register enough
5 // diagnostic information to render the higher-ranked subtyping error.
6
7 // check-fail
8
9 trait Trait {
10     type Ty;
11 }
12
13 impl Trait for &'static () {
14     type Ty = ();
15 }
16
17 fn main() {
18     let _: for<'a> fn(<&'a () as Trait>::Ty) = |_| {};
19     //~^ ERROR lifetime may not live long enough
20     //~| ERROR higher-ranked subtype error
21     //~| ERROR higher-ranked subtype error
22     //~| ERROR implementation of `Trait` is not general enough
23     //~| ERROR implementation of `Trait` is not general enough
24     //~| ERROR implementation of `Trait` is not general enough
25     //~| ERROR implementation of `Trait` is not general enough
26     //~| ERROR implementation of `Trait` is not general enough
27     //~| ERROR implementation of `Trait` is not general enough
28     //~| ERROR implementation of `Trait` is not general enough
29     //~| ERROR implementation of `Trait` is not general enough
30     //~| ERROR implementation of `Trait` is not general enough
31 }