]> git.proxmox.com Git - rustc.git/blame - src/test/ui/nll/issue-58299.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / nll / issue-58299.rs
CommitLineData
9fa01778
XL
1struct A<'a>(&'a ());
2
3trait Y {
4 const X: i32;
5}
6
7impl Y for A<'static> {
8 const X: i32 = 10;
9}
10
11fn foo<'a>(x: i32) {
12 match x {
13 // This uses <A<'a> as Y>::X, but `A<'a>` does not implement `Y`.
14 A::<'a>::X..=A::<'static>::X => (), //~ ERROR lifetime may not live long enough
15 _ => (),
16 }
17}
18
19fn bar<'a>(x: i32) {
20 match x {
21 // This uses <A<'a> as Y>::X, but `A<'a>` does not implement `Y`.
22 A::<'static>::X..=A::<'a>::X => (), //~ ERROR lifetime may not live long enough
23 _ => (),
24 }
25}
26
27fn main() {}