]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-55511.rs
Auto merge of #105121 - oli-obk:simpler-cheaper-dump_mir, r=nnethercote
[rust.git] / src / test / ui / nll / issue-55511.rs
1 #![warn(indirect_structural_match)]
2 use std::cell::Cell;
3 trait Foo<'a> {
4     const C: Option<Cell<&'a u32>>;
5 }
6
7 impl<'a, T> Foo<'a> for T {
8     const C: Option<Cell<&'a u32>> = None;
9 }
10
11 fn main() {
12     let a = 22;
13     let b = Some(Cell::new(&a));
14     //~^ ERROR `a` does not live long enough [E0597]
15     match b {
16         <() as Foo<'static>>::C => { }
17         _ => { }
18     }
19 }