forked from rust-lang/rust-clippy
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Only check the name of a single field * Don't lint in macros * Check for side effects * Don't use a binary heap
- Loading branch information
Showing
5 changed files
with
77 additions
and
41 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
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
12 changes: 6 additions & 6 deletions
12
tests/ui/numbered_fields.stderr → tests/ui/init_numbered_fields.stderr
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,33 +1,33 @@ | ||
error: used a field initializer for a tuple struct | ||
--> tests/ui/numbered_fields.rs:17:13 | ||
--> tests/ui/init_numbered_fields.rs:17:13 | ||
| | ||
LL | let _ = TupleStruct { | ||
| _____________^ | ||
LL | | 0: 1u32, | ||
LL | | 1: 42, | ||
LL | | 2: 23u8, | ||
LL | | }; | ||
| |_____^ help: try: `TupleStruct(1u32, 42, 23u8)` | ||
| |_____^ help: use tuple initialization: `TupleStruct(1u32, 42, 23u8)` | ||
| | ||
= note: `-D clippy::init-numbered-fields` implied by `-D warnings` | ||
= help: to override `-D warnings` add `#[allow(clippy::init_numbered_fields)]` | ||
|
||
error: used a field initializer for a tuple struct | ||
--> tests/ui/numbered_fields.rs:24:13 | ||
--> tests/ui/init_numbered_fields.rs:24:13 | ||
| | ||
LL | let _ = TupleStruct { | ||
| _____________^ | ||
LL | | 0: 1u32, | ||
LL | | 2: 2u8, | ||
LL | | 1: 3u32, | ||
LL | | }; | ||
| |_____^ help: try: `TupleStruct(1u32, 3u32, 2u8)` | ||
| |_____^ help: use tuple initialization: `TupleStruct(1u32, 3u32, 2u8)` | ||
|
||
error: used a field initializer for a tuple struct | ||
--> tests/ui/numbered_fields.rs:49:13 | ||
--> tests/ui/init_numbered_fields.rs:49:13 | ||
| | ||
LL | let _ = TupleStructVec { 0: vec![0, 1, 2, 3] }; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `TupleStructVec(vec![0, 1, 2, 3])` | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use tuple initialization: `TupleStructVec(vec![0, 1, 2, 3])` | ||
|
||
error: aborting due to 3 previous errors | ||
|