rust/library/core/src
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
..
alloc stabilize const_{size,align}_of_val 2024-12-02 20:18:25 +01:00
array Add '<[T]>::as_array', '<[T]>::as_mut_array', '<*const [T]>::as_array', and '<*mut [T]>::as_mut_array' conversion methods; 2024-11-26 21:49:28 +01:00
ascii Add more precondition check tests 2024-10-09 19:34:27 -04:00
async_iter Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
cell Re-do recursive const stability checks 2024-10-25 20:31:40 +02:00
char update cfgs 2024-11-27 15:14:54 +00:00
clone CloneToUninit: use a private specialization trait 2024-07-29 20:44:43 +03:00
cmp Use generic NonZero everywhere in core. 2024-02-22 15:17:33 +01:00
convert Fix doc nits 2024-07-26 13:26:33 +01:00
ffi update cfgs 2024-11-27 15:14:54 +00:00
fmt update cfgs 2024-11-27 15:14:54 +00:00
future update cfgs 2024-11-27 15:14:54 +00:00
hash stabilize const_collections_with_hasher and build_hasher_default_const_new 2024-12-02 16:34:39 +01:00
intrinsics Auto merge of #133818 - matthiaskrgr:rollup-iav1wq7, r=matthiaskrgr 2024-12-04 00:47:09 +00:00
io Add BorrowedBuf::into_filled{,_mut} methods to allow returning buffer with original lifetime 2024-11-02 14:26:21 -04:00
iter Also use zero when referencing to capacity or length 2024-11-28 09:47:11 +01:00
macros update cfgs 2024-11-27 15:14:54 +00:00
mem Rollup merge of #133762 - RalfJung:const-size-of-val, r=workingjubilee 2024-12-03 17:27:09 +01:00
net replace placeholder version 2024-11-27 12:10:21 +00:00
num Rollup merge of #133651 - scottmcm:nonnull-nonzero-no-field-projection, r=oli-obk 2024-12-04 05:42:07 +01:00
ops Add diagnostic item for std::ops::ControlFlow 2024-11-30 19:53:36 +01:00
panic replace placeholder version 2024-11-27 12:10:21 +00:00
prelude Avoid comments that describe multiple use items. 2024-07-17 08:02:46 +10:00
ptr Rollup merge of #133651 - scottmcm:nonnull-nonzero-no-field-projection, r=oli-obk 2024-12-04 05:42:07 +01:00
range Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
slice Rollup merge of #133743 - bjoernager:slice-as-array, r=joboet 2024-12-02 17:36:08 +01:00
str update cfgs 2024-11-27 15:14:54 +00:00
sync replace placeholder version 2024-11-27 12:10:21 +00:00
task update cfgs 2024-11-27 15:14:54 +00:00
unicode update cfgs 2024-11-27 15:14:54 +00:00
any.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
arch.rs Add core::arch::breakpoint and test 2024-12-02 23:56:24 -08:00
ascii.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
asserting.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
bool.rs [Clippy] Swap filter_map_bool_then to use diagnostic item instead of path 2024-09-19 13:13:42 +01:00
borrow.rs Suggest borrowing on fn argument that is impl AsRef 2024-05-09 23:25:31 +00:00
cell.rs get rid of a bunch of unnecessary rustc_const_unstable 2024-11-30 11:55:58 +01:00
clone.rs Make CloneToUninit dyn-compatible 2024-11-12 15:08:41 -06:00
cmp.rs library: consistently use American spelling for 'behavior' 2024-10-25 12:02:47 +02:00
default.rs update cfgs 2024-09-05 17:24:01 +01:00
error.md Mention core's PanicInfo in error.md. 2024-06-11 15:47:00 +02:00
error.rs Library: Rename "object safe" to "dyn compatible" 2024-10-09 18:48:29 +02:00
escape.rs Optimize escape_ascii 2024-10-09 17:17:50 -04:00
hint.rs update cfgs 2024-11-27 15:14:54 +00:00
internal_macros.rs Fix doc nits 2024-07-26 13:26:33 +01:00
lib.miri.rs add 'x.py miri', and make it work for 'library/{core,alloc,std}' 2024-04-03 20:27:20 +02:00
lib.rs remove a whole bunch of unnecessary const feature gates 2024-11-30 10:23:39 +01:00
marker.rs Constify Drop and Destruct 2024-11-25 17:27:41 +00:00
option.rs update cfgs 2024-11-27 15:14:54 +00:00
panic.rs update cfgs 2024-11-27 15:14:54 +00:00
panicking.rs update cfgs 2024-11-27 15:14:54 +00:00
pat.rs Add tracking issue to core-pattern-type 2024-08-07 20:43:05 -04:00
pin.rs Auto merge of #133533 - BoxyUwU:bump-boostrap, r=jieyouxu,Mark-Simulacrum 2024-11-29 22:39:10 +00:00
primitive.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
primitive_docs.rs Rollup merge of #132136 - RalfJung:target-feature-abi-compat, r=Mark-Simulacrum 2024-11-10 10:09:52 +01:00
random.rs random: add tracking issue, address other comments 2024-09-23 10:36:16 +02:00
range.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
result.rs update cfgs 2024-11-27 15:14:54 +00:00
time.rs get rid of a whole bunch of unnecessary rustc_const_unstable attributes 2024-11-02 09:59:55 +01:00
tuple.rs update cfgs 2024-09-05 17:24:01 +01:00
ub_checks.rs update cfgs 2024-11-27 15:14:54 +00:00
unit.rs Import the 2021 prelude in the core crate 2024-03-25 13:12:06 -07:00