-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #115893 - RalfJung:match-require-partial-eq, r=oli-obk
lint towards rejecting consts in patterns that do not implement PartialEq I think we definitely don't want to allow such consts, so even while the general plan around structural matching is up in the air, we can start the process of getting non-PartialEq matches out of the ecosystem.
- Loading branch information
Showing
8 changed files
with
139 additions
and
11 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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
warning: to use a constant of type `&[O<B>]` in a pattern, the type must implement `PartialEq` | ||
--> $DIR/issue-65466.rs:18:9 | ||
| | ||
LL | C => (), | ||
| ^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #116122 <https://github.com/rust-lang/rust/issues/116122> | ||
= note: `#[warn(const_patterns_without_partial_eq)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|
||
Future incompatibility report: Future breakage diagnostic: | ||
warning: to use a constant of type `&[O<B>]` in a pattern, the type must implement `PartialEq` | ||
--> $DIR/issue-65466.rs:18:9 | ||
| | ||
LL | C => (), | ||
| ^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #116122 <https://github.com/rust-lang/rust/issues/116122> | ||
= note: `#[warn(const_patterns_without_partial_eq)]` on by default | ||
|
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
warning: to use a constant of type `EnumSet<Enum8>` in a pattern, the type must implement `PartialEq` | ||
--> $DIR/issue-72896-non-partial-eq-const.rs:20:9 | ||
| | ||
LL | CONST_SET => { /* ok */ } | ||
| ^^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #116122 <https://github.com/rust-lang/rust/issues/116122> | ||
= note: `#[warn(const_patterns_without_partial_eq)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|
||
Future incompatibility report: Future breakage diagnostic: | ||
warning: to use a constant of type `EnumSet<Enum8>` in a pattern, the type must implement `PartialEq` | ||
--> $DIR/issue-72896-non-partial-eq-const.rs:20:9 | ||
| | ||
LL | CONST_SET => { /* ok */ } | ||
| ^^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #116122 <https://github.com/rust-lang/rust/issues/116122> | ||
= note: `#[warn(const_patterns_without_partial_eq)]` on by default | ||
|