summaryrefslogtreecommitdiffstats
path: root/tests/ui/nll/user-annotations/inherent-associated-constants.rs
blob: fe2641fd63b83ebd5f8962eff40b699cf42d8891 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
struct A<'a>(&'a ());

impl A<'static> {
    const IC: i32 = 10;
}

fn non_wf_associated_const<'a>(x: i32) {
    A::<'a>::IC; //~ ERROR lifetime may not live long enough
}

fn wf_associated_const<'a>(x: i32) {
    A::<'static>::IC;
}

fn main() {}