Stream: general

Topic: default derives vs custom ones


Luca Barbato (Mar 23 2019 at 08:03, on Zulip):

Today I'm trying to provide a workaround for https://github.com/rust-lang/rust/issues/59375

I noticed I cannot override PartialEq, is that something that would change in the future or I'm better off using a different name?

(incidentally where is PartialEq implemented?)

Jake Goulding (Mar 24 2019 at 13:08, on Zulip):

Today I'm trying to provide a workaround for https://github.com/rust-lang/rust/issues/59375

Wouldn't you just need to implement PartialEq by hand, applying #[inline(always) to the relevant functions?

Luca Barbato (Mar 25 2019 at 12:38, on Zulip):

For the varius enums in rav1e, yes.

Luca Barbato (Mar 25 2019 at 12:40, on Zulip):

inline(always) should be a good workaround. And since we have plenty of those enums I wanted to override PartialEq selectively :)

Jake Goulding (Mar 25 2019 at 16:19, on Zulip):

What do you mean by "override" and "PartialEq", specifically?

Jake Goulding (Mar 25 2019 at 16:20, on Zulip):

For the latter, you might be referring to overriding the trait or the derive

Luca Barbato (Mar 29 2019 at 12:09, on Zulip):

What do you mean by "override" and "PartialEq", specifically?

use mycrate::PartialEq;

#[derive(PartialEq)]
enum Foo { ..
Last update: Nov 21 2019 at 23:45UTC