]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #35926 - matthew-piziak:bit-or-xor-examples, r=GuillaumeGomez
authorJonathan Turner <jonathandturner@users.noreply.github.com>
Wed, 31 Aug 2016 13:29:08 +0000 (06:29 -0700)
committerGitHub <noreply@github.com>
Wed, 31 Aug 2016 13:29:08 +0000 (06:29 -0700)
add evocative examples for `BitOr` and `BitXor`

These are exactly equivalent to PR #35809, with one caveat: I do not believe there is a non-bitwise binary XOR operator in Rust, so here it's expressed as `(a || b) && !(a && b)`.

Alternative decompositions are `(a && !b) || (!a && b)` and `(a || b) && (!a || !b)`.  Let me know if you think one of those would be clearer.

r? @GuillaumeGomez

1  2 
src/libcore/ops.rs

Simple merge