mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 23:20:39 +00:00
23 lines
991 B
Text
23 lines
991 B
Text
error: returning a `str` unnecessarily tied to the lifetime of arguments
|
|
--> tests/ui/unnecessary_literal_bound.rs:9:30
|
|
|
|
|
LL | fn returns_lit(&self) -> &str {
|
|
| ^^^^ help: try: `&'static str`
|
|
|
|
|
= note: `-D clippy::unnecessary-literal-bound` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_literal_bound)]`
|
|
|
|
error: returning a `str` unnecessarily tied to the lifetime of arguments
|
|
--> tests/ui/unnecessary_literal_bound.rs:29:68
|
|
|
|
|
LL | fn contionally_returns_literals_explicit(&self, cond: bool) -> &str {
|
|
| ^^^^ help: try: `&'static str`
|
|
|
|
error: returning a `str` unnecessarily tied to the lifetime of arguments
|
|
--> tests/ui/unnecessary_literal_bound.rs:53:31
|
|
|
|
|
LL | fn trait_method(&self) -> &str {
|
|
| ^^^^ help: try: `&'static str`
|
|
|
|
error: aborting due to 3 previous errors
|
|
|