Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a comment about assert_receiver_is_total_eq #115888

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

RalfJung
Copy link
Member

"a type implements #[deriving]" doesn't make any sense, so I assume they meant "implement Eq"? Also the attribute is called derive.

@rustbot
Copy link
Collaborator

rustbot commented Sep 16, 2023

r? @m-ou-se

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 16, 2023
@dtolnay dtolnay assigned dtolnay and unassigned m-ou-se Sep 28, 2023
Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dtolnay
Copy link
Member

dtolnay commented Sep 28, 2023

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 28, 2023

📌 Commit d49123d has been approved by dtolnay

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 28, 2023
@dtolnay
Copy link
Member

dtolnay commented Sep 28, 2023

This leads me to wonder how true "doing this assertion without using a method on this trait is nearly impossible" still is, or if we should be generating something like:

// before
#[automatically_derived]
impl<$generics> ::core::cmp::Eq for $Thing {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<$FieldType>;
    }
}

// after
#[automatically_derived]
impl<$generics> ::core::cmp::Eq for $Thing {}
const _: () = {
    #[coverage(off)]
    fn assert_fields_are_total_eq<$generics>(_: &$Thing) {
        let _: ::core::cmp::AssertParamIsEq<$FieldType>;
    }
};

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 28, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#112959 (Change the wording in `std::fmt::Write::write_str`)
 - rust-lang#115535 (format doc-comment code examples in std::process)
 - rust-lang#115888 (fix a comment about assert_receiver_is_total_eq)
 - rust-lang#116211 (more clippy complextity fixes )
 - rust-lang#116213 (Document -Zlink-native-libraries)
 - rust-lang#116215 (Tweak wording of missing angle backets in qualified path)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 698448c into rust-lang:master Sep 28, 2023
11 checks passed
@rustbot rustbot added this to the 1.74.0 milestone Sep 28, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Sep 28, 2023
Rollup merge of rust-lang#115888 - RalfJung:assert_receiver_is_total_eq, r=dtolnay

fix a comment about assert_receiver_is_total_eq

"a type implements #[deriving]" doesn't make any sense, so I assume they meant "implement `Eq`"? Also the attribute is called `derive`.
@RalfJung RalfJung deleted the assert_receiver_is_total_eq branch September 30, 2023 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants