about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/mod.rs
diff options
context:
space:
mode:
authorAriel Davis <ariel.z.davis@icloud.com>2021-08-20 22:24:22 -0400
committerAriel Davis <ariel.z.davis@icloud.com>2021-08-20 22:24:22 -0400
commit003a636e760d50f4e1e96101f8e9994ac3758135 (patch)
tree1cd230a3e5766ff1cb0eb833cade312473bce68c /compiler/rustc_mir_transform/src/coverage/mod.rs
parent1e3d632f8f921d03ccc5b71d97decf980df7dbe4 (diff)
downloadrust-003a636e760d50f4e1e96101f8e9994ac3758135.tar.gz
rust-003a636e760d50f4e1e96101f8e9994ac3758135.zip
Add an example for deriving PartialOrd on enums
For some reason, I always forget which variants are smaller and which
are larger when you derive PartialOrd on an enum. And the wording in the
current docs is not entirely clear to me.

So, I often end up making a small enum, deriving PartialOrd on it, and
then writing a `#[test]` with an assert that the top one is smaller than
the bottom one (or the other way around) to figure out which way the
deriving goes.

So then I figured, it would be great if the standard library docs just
had that example, so if I keep forgetting, at least I can figure it out
quickly by looking at std's docs.
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/mod.rs')
0 files changed, 0 insertions, 0 deletions