]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-39970.rs
Rollup merge of #100168 - WaffleLapkin:improve_diagnostics_for_missing_type_in_a_cons...
[rust.git] / src / test / ui / issues / issue-39970.rs
1 trait Array<'a> {
2     type Element: 'a;
3 }
4
5 trait Visit {
6     fn visit() {}
7 }
8
9 impl<'a> Array<'a> for () {
10     type Element = &'a ();
11 }
12
13 impl Visit for () where
14     //(): for<'a> Array<'a, Element=&'a ()>, // No ICE
15     (): for<'a> Array<'a, Element=()>, // ICE
16 {}
17
18 fn main() {
19     <() as Visit>::visit();
20     //~^ ERROR type mismatch resolving `for<'a> <() as Array<'a>>::Element == ()`
21 }