rust/library/core/src
Ariel Davis 003a636e76 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.
2021-08-20 22:24:22 -04:00
..
alloc Consistent spelling of "adapter" in the standard library 2021-07-30 17:23:07 +02:00
array Constified Default implementations 2021-08-17 07:15:54 +00:00
char Add missing links for core::char types 2021-07-29 14:13:41 +02:00
convert impl const From<num> for num 2021-08-07 19:03:08 +02:00
fmt Rollup merge of #87052 - phlopsi:patch-1, r=jyn514 2021-07-30 16:26:52 +09:00
future Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
hash Rollup merge of #88031 - ibraheemdev:build-hasher-object-safe, r=m-ou-se 2021-08-18 19:54:57 +02:00
iter Constified Default implementations 2021-08-17 07:15:54 +00:00
macros Deprecate llvm_asm! 2021-08-15 13:14:32 +01:00
mem Auto merge of #87445 - amalik18:issue-83584-fix, r=kennytm 2021-07-30 04:34:13 +00:00
num Auto merge of #87150 - rusticstuff:simplify_wrapping_neg, r=m-ou-se 2021-08-04 12:58:31 +00:00
ops Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
panic Fix unused sync::atomic import on targets without atomics 2021-07-31 17:27:29 -07:00
prelude Move asm! and global_asm! to core::arch 2021-07-18 18:30:58 -04:00
ptr Auto merge of #87827 - eddyb:wrapperless-mem-replace, r=m-ou-se 2021-08-08 13:11:09 +00:00
slice Constified Default implementations 2021-08-17 07:15:54 +00:00
str Constified Default implementations 2021-08-17 07:15:54 +00:00
stream Add core::stream::from_iter 2021-06-23 17:49:26 +02:00
sync Constified Default implementations 2021-08-17 07:15:54 +00:00
task Update stable version of ready!() macro. 2021-07-28 16:56:12 +02:00
unicode Use HTTPS links where possible 2021-06-23 16:26:46 -04:00
any.rs Added diagnostic items to structs and traits for Clippy 2021-07-15 23:57:02 +02:00
ascii.rs Replace all fmt.pad with debug_struct 2021-04-21 14:38:24 +02:00
bool.rs Fix tracking issue for bool_to_option 2021-07-10 18:43:52 -04:00
borrow.rs Fix borrow and deref 2021-03-03 11:23:29 +01:00
cell.rs fix typo: whenver -> whenever 2021-07-26 22:12:35 +01:00
clone.rs Updates Clone docs for Copy comparison. 2021-06-10 11:28:26 -04:00
cmp.rs Add an example for deriving PartialOrd on enums 2021-08-20 22:24:22 -04:00
default.rs Constified Default implementations 2021-08-17 07:15:54 +00:00
ffi.rs Replace all fmt.pad with debug_struct 2021-04-21 14:38:24 +02:00
hint.rs Allow the use of the deprecated llvm_asm! in black_box 2021-08-15 13:14:32 +01:00
internal_macros.rs Remove unnecessary #[unstable] from internal macro. 2021-08-05 12:55:35 +02:00
intrinsics.rs Implement black_box using intrinsic 2021-08-12 16:16:57 +01:00
lazy.rs Capitalize safety comments 2020-09-08 22:26:44 -04:00
lib.rs Constified Default implementations 2021-08-17 07:15:54 +00:00
marker.rs Constified Default implementations 2021-08-17 07:15:54 +00:00
option.rs Constified Default implementations 2021-08-17 07:15:54 +00:00
panic.rs Move UnwindSafe, RefUnwindSafe, AssertUnwindSafe to core 2021-07-30 10:42:15 -07:00
panicking.rs Improve comments about const panic handling 2021-07-28 16:18:38 +02:00
pin.rs Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
primitive.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
result.rs Add documentation for the order of Option and Result 2021-08-01 13:59:19 +02:00
time.rs Added diagnostic items to structs and traits for Clippy 2021-07-15 23:57:02 +02:00
tuple.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
unit.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00