]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issue-55511.rs
Rollup merge of #57268 - peterhj:peterhj-optmergefunc, r=nagisa
[rust.git] / src / test / ui / issue-55511.rs
1 use std::cell::Cell;
2
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 }