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 {
|
2024-06-13 20:44:15 -04:00
|
|
|
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
|
2025-03-26 12:39:07 +00:00
|
|
|
//~| ERROR lifetime parameters or bounds on const `STATIC` do not match the trait declaration
|
2024-06-13 20:33:43 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {}
|