about summary refs log tree commit diff
path: root/tests/ui/consts/static-default-lifetime/elided-lifetime.rs
blob: d60fe7d409af99d5b623fcd2e5dd208ebfdd46e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#![deny(elided_lifetimes_in_associated_constant)]

struct Foo<'a>(&'a ());

impl Foo<'_> {
    const STATIC: &str = "";
    //~^ ERROR `&` without an explicit lifetime name cannot be used here
    //~| WARN this was previously accepted by the compiler but is being phased out
}

trait Bar {
    const STATIC: &str;
}

impl Bar for Foo<'_> {
    const STATIC: &str = "";
    //~^ ERROR `&` without an explicit lifetime name cannot be used here
    //~| WARN this was previously accepted by the compiler but is being phased out
    //~| ERROR lifetime parameters or bounds on associated const `STATIC` do not match the trait declaration
}

fn main() {}