-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #104154 - timrobertsdev:deny-by-default-bindings_with…
…_variant_name, r=scottmcm Change `bindings_with_variant_name` to deny-by-default Changed the `bindings_with_variant_name` lint to deny-by-default and fixed up the affected tests. Addresses #103442.
- Loading branch information
Showing
14 changed files
with
55 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
warning[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo` | ||
--> $DIR/issue-19100.rs:18:1 | ||
error[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo` | ||
--> $DIR/issue-19100.rs:17:1 | ||
| | ||
LL | Bar if true | ||
| ^^^ help: to match on the variant, qualify the path: `Foo::Bar` | ||
| | ||
= note: `#[warn(bindings_with_variant_name)]` on by default | ||
= note: `#[deny(bindings_with_variant_name)]` on by default | ||
|
||
warning[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo` | ||
--> $DIR/issue-19100.rs:22:1 | ||
error[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo` | ||
--> $DIR/issue-19100.rs:21:1 | ||
| | ||
LL | Baz if false | ||
| ^^^ help: to match on the variant, qualify the path: `Foo::Baz` | ||
|
||
warning: 2 warnings emitted | ||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0170`. |
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
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
28 changes: 14 additions & 14 deletions
28
tests/ui/pattern/issue-67776-match-same-name-enum-variant-refs.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,41 +1,41 @@ | ||
warning[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo` | ||
--> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:17:9 | ||
error[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo` | ||
--> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:15:9 | ||
| | ||
LL | Bar => {}, | ||
| ^^^ help: to match on the variant, qualify the path: `Foo::Bar` | ||
| | ||
= note: `#[warn(bindings_with_variant_name)]` on by default | ||
= note: `#[deny(bindings_with_variant_name)]` on by default | ||
|
||
warning[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo` | ||
--> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:19:9 | ||
error[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo` | ||
--> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:17:9 | ||
| | ||
LL | Baz => {}, | ||
| ^^^ help: to match on the variant, qualify the path: `Foo::Baz` | ||
|
||
warning[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo` | ||
--> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:26:9 | ||
error[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo` | ||
--> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:24:9 | ||
| | ||
LL | Bar => {}, | ||
| ^^^ help: to match on the variant, qualify the path: `Foo::Bar` | ||
|
||
warning[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo` | ||
--> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:28:9 | ||
error[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo` | ||
--> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:26:9 | ||
| | ||
LL | Baz => {}, | ||
| ^^^ help: to match on the variant, qualify the path: `Foo::Baz` | ||
|
||
warning[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo` | ||
--> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:35:9 | ||
error[E0170]: pattern binding `Bar` is named the same as one of the variants of the type `Foo` | ||
--> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:33:9 | ||
| | ||
LL | Bar => {}, | ||
| ^^^ help: to match on the variant, qualify the path: `Foo::Bar` | ||
|
||
warning[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo` | ||
--> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:37:9 | ||
error[E0170]: pattern binding `Baz` is named the same as one of the variants of the type `Foo` | ||
--> $DIR/issue-67776-match-same-name-enum-variant-refs.rs:35:9 | ||
| | ||
LL | Baz => {}, | ||
| ^^^ help: to match on the variant, qualify the path: `Foo::Baz` | ||
|
||
warning: 6 warnings emitted | ||
error: aborting due to 6 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0170`. |
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