Nicholas Nethercote

Results 205 comments of Nicholas Nethercote

> This could change if [`#[rustc_must_implement_one_of(eq, ne)]`](https://github.com/rust-lang/rust/pull/92164) is applied to `Eq`/`PartialEq`. This was one of the use case for implementing `rustc_must_implement_one_of`, there is even an UI test that test this...

Also, the generated docs look like this: ![Equal](https://user-images.githubusercontent.com/1940286/177223461-3563d04b-5ca6-499a-a4ec-9c667e717e98.png) Both methods are labelled as provided, but there's no indication that you must implement one of them.

I see, thanks for the explanation. So the `rustc_must_implement_one_of` name is a little ambiguous. `rustc_must_implement_at_least_one_of` would be clearer.

Let me try to summarize the situation. There are three options, which are probably cumulative, and require increasing amounts of effort. 1. Stop deriving `ne` - Stop deriving `ne` methods...

> We could update the documentation to strongly recommend not implementing ne. I just pushed new changes that include such documentation updates. I added a note to the trait docs...

@bors try @rust-timer queue

The perf improvements are slightly reduced from before. This is because I've been improving the generated output for derives in other PRs, which means the `ne` methods being removed are...

> It's actually not much work at all to implement. This case of `#[deprecate]` is already checked and handled separately, here: > > https://github.com/rust-lang/rust/blob/3dcb616888aac50d55160b025266d555dad937d9/compiler/rustc_passes/src/stability.rs#L763-L764 @m-ou-se Can you elaborate? That file...

@Pointerbender: thanks for the info. If I've understood correctly you are saying there are cases where hand-writing both `eq` and `ne` is useful? If so, that's presumably an argument in...

> This will be merged soon. What does this mean? Will it happen automatically? Does someone need to r+ it?