]> git.lizzy.rs Git - rust.git/commit
derive: Avoid emitting PartialEq::ne for c-like enums
authorUlrik Sverdrup <bluss@users.noreply.github.com>
Mon, 29 Feb 2016 20:27:20 +0000 (21:27 +0100)
committerUlrik Sverdrup <bluss@users.noreply.github.com>
Mon, 29 Feb 2016 20:27:20 +0000 (21:27 +0100)
commit190af51f303e21e22ea0a4d7dffeb09805d19010
tree8b67a748b9c4b880533a465a0b1927a2ea2f1ff0
parent09130044ce7429beb95742afa7fd371960dbe607
derive: Avoid emitting PartialEq::ne for c-like enums

`ne` is completely symmetrical with the method `eq`, and we can save
rust code size and compilation time here if we only emit one of them
when possible.

One case where it's easy to recognize is when it's a C-like enum. Most
other cases can not omit ne, because any value field may have a custom
PartialEq implementation.
src/libsyntax_ext/deriving/cmp/partial_eq.rs