]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-58299.rs
Rollup merge of #83807 - sjakobi:77548-remove-ignore-annotations, r=Mark-Simulacrum
[rust.git] / src / test / ui / nll / issue-58299.rs
1 #![feature(nll)]
2
3 struct A<'a>(&'a ());
4
5 trait Y {
6     const X: i32;
7 }
8
9 impl Y for A<'static> {
10     const X: i32 = 10;
11 }
12
13 fn foo<'a>(x: i32) {
14     match x {
15         // This uses <A<'a> as Y>::X, but `A<'a>` does not implement `Y`.
16         A::<'a>::X..=A::<'static>::X => (), //~ ERROR lifetime may not live long enough
17         _ => (),
18     }
19 }
20
21 fn bar<'a>(x: i32) {
22     match x {
23         // This uses <A<'a> as Y>::X, but `A<'a>` does not implement `Y`.
24         A::<'static>::X..=A::<'a>::X => (), //~ ERROR lifetime may not live long enough
25         _ => (),
26     }
27 }
28
29 fn main() {}