Closed
Description
Clippy and rustc don't seem to agree when it comes to declaring static associated constant lifetimes.
trait Foo {
const BAR: &'static str = "bar";
}
clippy
warning: Constants have by default a `'static` lifetime
--> src/main.rs:5:17
|
5 | const BAR: &'static str = "bar";
| -^^^^^^^---- help: consider removing `'static`: `&str`
rustc
error[E0106]: missing lifetime specifier
--> src/main.rs:5:16
|
5 | const BAR: &str = "bar";
| ^ expected lifetime parameter
Metadata
Metadata
Assignees
Labels
No labels