summary refs log tree commit diff
path: root/src/test/ui/issue-55511.rs
blob: 4b9475ba627183092b85f9a2d406018893c8c6ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use std::cell::Cell;

trait Foo<'a> {
    const C: Option<Cell<&'a u32>>;
}

impl<'a, T> Foo<'a> for T {
    const C: Option<Cell<&'a u32>> = None;
}

fn main() {
    let a = 22;
    let b = Some(Cell::new(&a));
    //~^ ERROR `a` does not live long enough [E0597]
    match b {
        <() as Foo<'static>>::C => { }
        _ => { }
    }
}