rust/library/core/src
Yuki Okushi 8e4869e862
Rollup merge of #102368 - beetrees:nano-niche, r=joshtriplett
Add a niche to `Duration`, unix `SystemTime`, and non-apple `Instant`

As the nanoseconds fields is always between `0` and `(NANOS_PER_SEC - 1)` inclusive, use the `rustc_layout_scalar_valid_range` attributes to create a niche in the nanosecond field of `Duration` and `Timespec` (which is used to implement unix `SystemTime` and non-apple unix `Instant`; windows `Instant` is implemented with `Duration` and therefore will also benefit). This change has the benefit of making `Option<T>` the same size as `T` for the previously mentioned types. Also shrinks the nanoseconds field of `Timespec` to a `u32` as nanoseconds do not need the extra range of an `i64`, shrinking `Timespec` by 4 bytes on 32-bit platforms.

r? ```@joshtriplett```
2022-09-29 11:42:05 +09:00
..
alloc remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
array remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
async_iter
cell
char remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
convert remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
ffi Rollup merge of #100291 - WaffleLapkin:cstr_const_methods, r=oli-obk 2022-09-12 22:47:14 +02:00
fmt Document that Display entails ToString 2022-09-26 13:03:59 -04:00
future
hash
iter Rollup merge of #102263 - GuillaumeGomez:iterator-rposition-example, r=thomcc 2022-09-26 09:27:37 +08:00
macros Fix typo in concat_bytes documentation 2022-09-12 21:40:28 -04:00
mem remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
num Rollup merge of #101555 - jhpratt:stabilize-mixed_integer_ops, r=joshtriplett 2022-09-27 21:42:21 +02:00
ops remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
panic
prelude
ptr remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
slice rustdoc: Update doc comment for splitn_mut to include mutable in the description 2022-09-26 20:20:13 +02:00
str remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
sync Add #[inline] to trivial functions on core::sync::Exclusive 2022-09-22 22:15:27 -07:00
task Added tracking issue 2022-09-19 15:07:12 +02:00
unicode Bump Unicode to version 15.0.0, regenerate tables 2022-09-14 13:21:19 -07:00
any.rs Add Provider::{would_be_satisfied_by_value_of,would_be_satisfied_by_ref_of} 2022-08-23 10:48:59 -04:00
ascii.rs
asserting.rs
bool.rs Add missing assertion 2022-09-22 02:12:06 -04:00
borrow.rs Add const_traits 2022-09-16 11:48:42 +08:00
cell.rs Address feedback 2022-09-27 21:42:09 +02:00
clone.rs
cmp.rs Constify cmp_min_max_by 2022-09-24 22:12:00 +02:00
const_closure.rs Remove unused ConstFn(Once)Closure structs. 2022-09-23 19:55:51 +02:00
default.rs Prevent errors for stage0 rustc build 2022-09-16 11:48:42 +08:00
error.md Move error trait into core 2022-08-22 13:28:25 -07:00
error.rs error::Error: remove some comments 2022-08-25 07:42:07 +01:00
hint.rs Stabilize bench_black_box 2022-09-27 17:38:51 +02:00
internal_macros.rs
intrinsics.rs core: Mark all safe intrinsics with #[rustc_safe_intrinsic] 2022-09-27 15:55:42 +02:00
lazy.rs
lib.rs Rollup merge of #101555 - jhpratt:stabilize-mixed_integer_ops, r=joshtriplett 2022-09-27 21:42:21 +02:00
marker.rs remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
option.rs Improve code example for Option::unwrap_or_default 2022-09-26 12:37:41 +02:00
panic.rs
panicking.rs Reduce code size of assert_matches_failed 2022-08-24 00:56:04 +02:00
pin.rs
primitive_docs.rs array docs - advertise how to get array from slice 2022-09-10 19:37:07 -07:00
primitive.rs
result.rs Constify Residual behind const_try 2022-09-23 20:17:31 +02:00
time.rs Add a niche to Duration, unix SystemTime, and non-apple Instant 2022-09-28 18:15:10 +01:00
tuple.rs Added const Default impls for Arrays and Tuples. 2022-09-23 17:53:59 +02:00
unit.rs