rust/library/core/src/num
Matthias Krüger 68f8a53f12
Rollup merge of #133651 - scottmcm:nonnull-nonzero-no-field-projection, r=oli-obk
Update `NonZero` and `NonNull` to not field-project (per MCP#807)

https://github.com/rust-lang/compiler-team/issues/807#issuecomment-2506098540 was accepted, so this is the first PR towards moving the library to not using field projections into `[rustc_layout_scalar_valid_range_*]` types.

`NonZero` was already using `transmute` nearly everywhere, so there are very few changes to it.

`NonNull` needed more changes, but they're mostly simple, changing `.pointer` to `.as_ptr()`.

r? libs

cc #133324, which will tidy up some of the MIR from this a bit more, but isn't a blocker.
2024-12-04 05:42:07 +01:00
..
dec2flt update outdated comment about test-float-parse 2024-11-13 23:17:32 +03:00
flt2dec Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
shells diagnostic items for legacy numeric constants 2024-02-18 12:08:16 -07:00
bignum.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
diy_float.rs Fix assert in diy_float 2021-07-27 16:02:35 -04:00
error.rs replace placeholder version 2024-09-03 20:54:02 +01:00
f16.rs Fix f16::midpoint const feature gate 2024-12-02 18:26:00 +01:00
f32.rs Stabilize unsigned num_midpoint feature 2024-12-01 11:28:53 +01:00
f64.rs Stabilize unsigned num_midpoint feature 2024-12-01 11:28:53 +01:00
f128.rs Stabilize unsigned num_midpoint feature 2024-12-01 11:28:53 +01:00
fmt.rs Fix a bunch of typos 2021-12-14 16:40:43 +01:00
int_log10.rs Have a function for the log(0) panic, rather than copy-pasting the string constant 2023-02-10 12:50:17 -08:00
int_macros.rs Auto merge of #133533 - BoxyUwU:bump-boostrap, r=jieyouxu,Mark-Simulacrum 2024-11-29 22:39:10 +00:00
int_sqrt.rs Speed up checked_isqrt and isqrt methods 2024-08-28 23:07:04 -04:00
mod.rs Rollup merge of #131784 - Urgau:stabilize-midpoint, r=dtolnay 2024-12-01 21:38:24 -05:00
nonzero.rs Rollup merge of #133651 - scottmcm:nonnull-nonzero-no-field-projection, r=oli-obk 2024-12-04 05:42:07 +01:00
overflow_panic.rs reword panic comments and add spaces to unlikely branches 2023-11-28 08:34:55 -08:00
saturating.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
uint_macros.rs Update the definition of borrowing_sub 2024-12-03 15:31:00 +01:00
wrapping.rs library: consistently use American spelling for 'behavior' 2024-10-25 12:02:47 +02:00