-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 #120805 - RalfJung:const-pat-partial-eq, r=oli-obk
make non-PartialEq-typed consts as patterns a hard error This lint was introduced in #115893, for Rust 1.74, so we just had the third stable release where this is shown as a future-compat lint (which is shown for dependencies). Not a single comment or backreference showed up in the tracking issue, #116122. So this seems fairly safe to turn into a hard error. Of course we should do a crater run first. This is part of #120362. Closes #116122.
- Loading branch information
Showing
8 changed files
with
27 additions
and
112 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 |
---|---|---|
@@ -1,23 +1,8 @@ | ||
warning: to use a constant of type `&[O<B>]` in a pattern, the type must implement `PartialEq` | ||
--> $DIR/issue-65466.rs:18:9 | ||
error: to use a constant of type `&[O<B>]` in a pattern, the type must implement `PartialEq` | ||
--> $DIR/issue-65466.rs:14: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 | ||
error: aborting due to 1 previous error | ||
|
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,23 +1,8 @@ | ||
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 | ||
error: to use a constant of type `EnumSet<Enum8>` in a pattern, the type must implement `PartialEq` | ||
--> $DIR/issue-72896-non-partial-eq-const.rs:19: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 | ||
error: aborting due to 1 previous error | ||
|