Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better linting : use of span_lint_and_then.
- Loading branch information
Showing
2 changed files
with
34 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,52 @@ | ||
warning: running cargo clippy on a crate that also imports the clippy plugin | ||
|
||
error: Constants have by default a `'static` lifetime | ||
--> $DIR/const_static_lifetime.rs:6:17 | ||
--> $DIR/const_static_lifetime.rs:7:17 | ||
| | ||
6 | const VAR_ONE: &'static str = "Test constant #1"; // ERROR Consider removing 'static. | ||
| ^^^^^^^ | ||
7 | const VAR_ONE: &'static str = "Test constant #1"; // ERROR Consider removing 'static. | ||
| ^^^^^^^ help: consider removing `'static`: `&str` | ||
| | ||
= note: `-D const-static-lifetime` implied by `-D warnings` | ||
= help: consider removing `'static` | ||
|
||
error: Constants have by default a `'static` lifetime | ||
--> $DIR/const_static_lifetime.rs:10:21 | ||
| | ||
10 | const VAR_THREE: &[&'static str] = &["one", "two"]; // ERROR Consider removing 'static | ||
| ^^^^^^^ | ||
--> $DIR/const_static_lifetime.rs:11:21 | ||
| | ||
= help: consider removing `'static` | ||
11 | const VAR_THREE: &[&'static str] = &["one", "two"]; // ERROR Consider removing 'static | ||
| ^^^^^^^ help: consider removing `'static`: `&str` | ||
|
||
error: Constants have by default a `'static` lifetime | ||
--> $DIR/const_static_lifetime.rs:12:32 | ||
--> $DIR/const_static_lifetime.rs:13:32 | ||
| | ||
12 | const VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static | ||
| ^^^^^^^ | ||
| | ||
= help: consider removing `'static` | ||
13 | const VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static | ||
| ^^^^^^^ help: consider removing `'static`: `&str` | ||
|
||
error: Constants have by default a `'static` lifetime | ||
--> $DIR/const_static_lifetime.rs:12:47 | ||
| | ||
12 | const VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static | ||
| ^^^^^^^ | ||
--> $DIR/const_static_lifetime.rs:13:47 | ||
| | ||
= help: consider removing `'static` | ||
13 | const VAR_FOUR: (&str, (&str, &'static str), &'static str) = ("on", ("th", "th"), "on"); // ERROR Consider removing 'static | ||
| ^^^^^^^ help: consider removing `'static`: `&str` | ||
|
||
error: Constants have by default a `'static` lifetime | ||
--> $DIR/const_static_lifetime.rs:14:30 | ||
--> $DIR/const_static_lifetime.rs:15:30 | ||
| | ||
14 | const VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR Consider removing 'static | ||
| ^^^^^^^ | ||
| | ||
= help: consider removing `'static` | ||
15 | const VAR_FIVE: &'static [&[&'static str]] = &[&["test"], &["other one"]]; // ERROR Consider removing 'static | ||
| ^^^^^^^ help: consider removing `'static`: `&str` | ||
|
||
error: Constants have by default a `'static` lifetime | ||
--> $DIR/const_static_lifetime.rs:16:17 | ||
| | ||
16 | const VAR_SIX: &'static u8 = &5; | ||
| ^^^^^^^ | ||
--> $DIR/const_static_lifetime.rs:17:17 | ||
| | ||
= help: consider removing `'static` | ||
17 | const VAR_SIX: &'static u8 = &5; | ||
| ^^^^^^^ help: consider removing `'static`: `&u8` | ||
|
||
error: Constants have by default a `'static` lifetime | ||
--> $DIR/const_static_lifetime.rs:18:39 | ||
--> $DIR/const_static_lifetime.rs:19:39 | ||
| | ||
18 | const VAR_SEVEN: &[&(&str, &'static [&'static str])] = &[&("one", &["other one"])]; | ||
| ^^^^^^^ | ||
| | ||
= help: consider removing `'static` | ||
19 | const VAR_SEVEN: &[&(&str, &'static [&'static str])] = &[&("one", &["other one"])]; | ||
| ^^^^^^^ help: consider removing `'static`: `&str` | ||
|
||
error: Constants have by default a `'static` lifetime | ||
--> $DIR/const_static_lifetime.rs:20:20 | ||
| | ||
20 | const VAR_HEIGHT: &'static Foo = &Foo {}; | ||
| ^^^^^^^ | ||
--> $DIR/const_static_lifetime.rs:21:20 | ||
| | ||
= help: consider removing `'static` | ||
21 | const VAR_HEIGHT: &'static Foo = &Foo {}; | ||
| ^^^^^^^ help: consider removing `'static`: `&Foo` | ||
|