about summary refs log tree commit diff
path: root/tests/ui/suggestions/missing-lifetime-in-assoc-const-type.rs
blob: a60f0b94587f80bccceda46fba8d302c6990f4fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//@ revisions: default generic_const_items

#![cfg_attr(generic_const_items, feature(generic_const_items), allow(incomplete_features))]

trait ZstAssert: Sized {
    const A: &str = "";
    const B: S = S { s: &() }; //~ ERROR implicit elided lifetime not allowed here
    const C: &'_ str = "";
    const D: T = T { a: &(), b: &() }; //~ ERROR implicit elided lifetime not allowed here
}

struct S<'a> {
    s: &'a (),
}
struct T<'a, 'b> {
    a: &'a (),
    b: &'b (),
}

fn main() {}