Files
rust/tests/ui/consts/static-default-lifetime/elided-lifetime.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
640 B
Rust
Raw Normal View History

2024-06-13 20:33:43 -04:00
#![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;
2024-06-13 20:33:43 -04:00
}
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 const `STATIC` do not match the trait declaration
2024-06-13 20:33:43 -04:00
}
fn main() {}