deprecate Eq::assert_receiver_is_total_eq and emit FCW on manual impls#149978
Conversation
This comment has been minimized.
This comment has been minimized.
faf29de to
81dc07d
Compare
Eq::assert_receiver_is_total_eq and emit a FCW on manual …Eq::assert_receiver_is_total_eq and emit FCW on manual impls
|
Since there's never a valid reason to manually implement this method, having an FCW urging people to remove their manual implementation seems like the best way to go. @rfcbot merge libs-api lang |
|
Error encounted: |
|
@rfcbot merge |
|
Error encounted: |
|
@rfcbot merge libs-api,lang |
|
Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
This comment has been minimized.
This comment has been minimized.
03140f2 to
2688fd9
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Looks good, thanks!
Feel free to merge with or without my nit comments.
@bors rollup delegate+
|
CI error is: Either allow that lint, if not I'd also be fine with just naming the version that this'll get merged into. |
|
Bors doesn't seem to like comments in reviews, so: |
2688fd9 to
f1ec10e
Compare
|
@bors r=madsmtm |
…od, r=madsmtm deprecate `Eq::assert_receiver_is_total_eq` and emit FCW on manual impls The `Eq::assert_receiver_is_total_eq` method is purely meant as an implementation detail by `#[derive(Eq)]` to add checks that all fields of the type the derive is applied to also implement `Eq`. The method is already `#[doc(hidden)]` and has a comment saying `// This should never be implemented by hand.`. Unfortunately, it has been stable since 1.0 and there are some cases on GitHub (https://github.com/search?q=assert_receiver_is_total_eq&type=code) where people have implemented this method manually, sometimes even with actual code in the method body (example: https://github.com/Shresht7/codecrafters-redis-rust/blob/31f0ec453c504b4ab053a7b1c3ff548ff36a9db5/src/parser/resp/types.rs#L255). To prevent further confusion from this, this PR is deprecating the method and adds a FCW when it is manually implemented (this is necessary as the deprecation warning is not emitted when the method is implemented, only when it is called). This is similar to what was previously done with the `soft_unstable` lint (rust-lang#64266). See also rust-lang/libs-team#704.
…od, r=madsmtm deprecate `Eq::assert_receiver_is_total_eq` and emit FCW on manual impls The `Eq::assert_receiver_is_total_eq` method is purely meant as an implementation detail by `#[derive(Eq)]` to add checks that all fields of the type the derive is applied to also implement `Eq`. The method is already `#[doc(hidden)]` and has a comment saying `// This should never be implemented by hand.`. Unfortunately, it has been stable since 1.0 and there are some cases on GitHub (https://github.com/search?q=assert_receiver_is_total_eq&type=code) where people have implemented this method manually, sometimes even with actual code in the method body (example: https://github.com/Shresht7/codecrafters-redis-rust/blob/31f0ec453c504b4ab053a7b1c3ff548ff36a9db5/src/parser/resp/types.rs#L255). To prevent further confusion from this, this PR is deprecating the method and adds a FCW when it is manually implemented (this is necessary as the deprecation warning is not emitted when the method is implemented, only when it is called). This is similar to what was previously done with the `soft_unstable` lint (rust-lang#64266). See also rust-lang/libs-team#704.
…od, r=madsmtm deprecate `Eq::assert_receiver_is_total_eq` and emit FCW on manual impls The `Eq::assert_receiver_is_total_eq` method is purely meant as an implementation detail by `#[derive(Eq)]` to add checks that all fields of the type the derive is applied to also implement `Eq`. The method is already `#[doc(hidden)]` and has a comment saying `// This should never be implemented by hand.`. Unfortunately, it has been stable since 1.0 and there are some cases on GitHub (https://github.com/search?q=assert_receiver_is_total_eq&type=code) where people have implemented this method manually, sometimes even with actual code in the method body (example: https://github.com/Shresht7/codecrafters-redis-rust/blob/31f0ec453c504b4ab053a7b1c3ff548ff36a9db5/src/parser/resp/types.rs#L255). To prevent further confusion from this, this PR is deprecating the method and adds a FCW when it is manually implemented (this is necessary as the deprecation warning is not emitted when the method is implemented, only when it is called). This is similar to what was previously done with the `soft_unstable` lint (rust-lang#64266). See also rust-lang/libs-team#704.
…od, r=madsmtm deprecate `Eq::assert_receiver_is_total_eq` and emit FCW on manual impls The `Eq::assert_receiver_is_total_eq` method is purely meant as an implementation detail by `#[derive(Eq)]` to add checks that all fields of the type the derive is applied to also implement `Eq`. The method is already `#[doc(hidden)]` and has a comment saying `// This should never be implemented by hand.`. Unfortunately, it has been stable since 1.0 and there are some cases on GitHub (https://github.com/search?q=assert_receiver_is_total_eq&type=code) where people have implemented this method manually, sometimes even with actual code in the method body (example: https://github.com/Shresht7/codecrafters-redis-rust/blob/31f0ec453c504b4ab053a7b1c3ff548ff36a9db5/src/parser/resp/types.rs#L255). To prevent further confusion from this, this PR is deprecating the method and adds a FCW when it is manually implemented (this is necessary as the deprecation warning is not emitted when the method is implemented, only when it is called). This is similar to what was previously done with the `soft_unstable` lint (rust-lang#64266). See also rust-lang/libs-team#704.
…uwer Rollup of 13 pull requests Successful merges: - #153079 (Revert "Move aarch64-apple dist builder to dynamic llvm linking") - #148146 (CI: use alternative disks if available) - #149937 (spliit out `linker-info` from `linker-messages`) - #151771 (Fix: On wasm targets, call `panic_in_cleanup` if panic occurs in cleanup) - #153035 (rustc_target: callconv: powerpc64: Use llvm_abiname rather than target_abi for ABI determination) - #153075 (mGCA: Lower negated literals directly and reject non-integer negations) - #153078 (Remove `QuerySystemFns`) - #149978 (deprecate `Eq::assert_receiver_is_total_eq` and emit FCW on manual impls) - #153029 (Rename `rustc::pass_by_value` lint as `rustc::disallowed_pass_by_ref`.) - #153063 (`is_ty_must_use`: do not require a `span` argument) - #153071 (Update books) - #153092 (Remove redundant self usages) - #153094 (Simplify `AppendOnlyVec` iterators) Failed merges: - #153091 (Migration of `LintDiagnostic` - part 4)
Rollup of 13 pull requests Successful merges: - #148146 (CI: use alternative disks if available) - #151771 (Fix: On wasm targets, call `panic_in_cleanup` if panic occurs in cleanup) - #153035 (rustc_target: callconv: powerpc64: Use llvm_abiname rather than target_abi for ABI determination) - #153075 (mGCA: Lower negated literals directly and reject non-integer negations) - #153078 (Remove `QuerySystemFns`) - #153089 (interpret: avoid dummy spans in the stacktrace) - #153111 (Refactor url_parts to return is_absolute instead of out param) - #149978 (deprecate `Eq::assert_receiver_is_total_eq` and emit FCW on manual impls) - #153029 (Rename `rustc::pass_by_value` lint as `rustc::disallowed_pass_by_ref`.) - #153063 (`is_ty_must_use`: do not require a `span` argument) - #153071 (Update books) - #153092 (Remove redundant self usages) - #153094 (Simplify `AppendOnlyVec` iterators) Failed merges: - #153091 (Migration of `LintDiagnostic` - part 4)
Rollup merge of #149978 - cyrgani:no-eq-assert-receiver-method, r=madsmtm deprecate `Eq::assert_receiver_is_total_eq` and emit FCW on manual impls The `Eq::assert_receiver_is_total_eq` method is purely meant as an implementation detail by `#[derive(Eq)]` to add checks that all fields of the type the derive is applied to also implement `Eq`. The method is already `#[doc(hidden)]` and has a comment saying `// This should never be implemented by hand.`. Unfortunately, it has been stable since 1.0 and there are some cases on GitHub (https://github.com/search?q=assert_receiver_is_total_eq&type=code) where people have implemented this method manually, sometimes even with actual code in the method body (example: https://github.com/Shresht7/codecrafters-redis-rust/blob/31f0ec453c504b4ab053a7b1c3ff548ff36a9db5/src/parser/resp/types.rs#L255). To prevent further confusion from this, this PR is deprecating the method and adds a FCW when it is manually implemented (this is necessary as the deprecation warning is not emitted when the method is implemented, only when it is called). This is similar to what was previously done with the `soft_unstable` lint (#64266). See also rust-lang/libs-team#704.
View all comments
The
Eq::assert_receiver_is_total_eqmethod is purely meant as an implementation detail by#[derive(Eq)]to add checks that all fields of the type the derive is applied to also implementEq.The method is already
#[doc(hidden)]and has a comment saying// This should never be implemented by hand..Unfortunately, it has been stable since 1.0 and there are some cases on GitHub (https://github.com/search?q=assert_receiver_is_total_eq&type=code) where people have implemented this method manually, sometimes even with actual code in the method body (example: https://github.com/Shresht7/codecrafters-redis-rust/blob/31f0ec453c504b4ab053a7b1c3ff548ff36a9db5/src/parser/resp/types.rs#L255).
To prevent further confusion from this, this PR is deprecating the method and adds a FCW when it is manually implemented (this is necessary as the deprecation warning is not emitted when the method is implemented, only when it is called).
This is similar to what was previously done with the
soft_unstablelint (#64266).See also rust-lang/libs-team#704.