rust/library/core/tests
bors 9fed13030c Auto merge of #94954 - SimonSapin:null-thin3, r=yaahc
Extend ptr::null and null_mut to all thin (including extern) types

Fixes https://github.com/rust-lang/rust/issues/93959

This change was accepted in https://rust-lang.github.io/rfcs/2580-ptr-meta.html

Note that this changes the signature of **stable** functions. The change should be backward-compatible, but it is **insta-stable** since it cannot (easily, at all?) be made available only through a `#![feature(…)]` opt-in.

The RFC also proposed the same change for `NonNull::dangling`, which makes sense it terms of its signature but not in terms of its implementation. `dangling` uses `align_of()` as an address. But what `align_of()` should be for extern types or whether it should be allowed at all remains an open question.

This commit depends on https://github.com/rust-lang/rust/pull/93977, which is not yet part of the bootstrap compiler. So `#[cfg]` is used to only apply the change in stage 1+. As far a I know bounds cannot be made conditional with `#[cfg]`, so the entire functions are duplicated. This is unfortunate but temporary.

Since this duplication makes it less obvious in the diff, the new definitions differ in:

* More permissive bounds (`Thin` instead of implied `Sized`)
* Different implementation
* Having `rustc_allow_const_fn_unstable(const_fn_trait_bound)`
* Having `rustc_allow_const_fn_unstable(ptr_metadata)`
2022-05-25 13:58:51 +00:00
..
fmt Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
hash Add a dedicated length-prefixing method to Hasher 2022-05-06 00:03:38 -07:00
iter Rollup merge of #94115 - scottmcm:iter-process-by-ref, r=yaahc 2022-03-18 21:50:44 +01:00
num Update int_roundings methods from feedback 2022-05-04 23:20:29 -04:00
ops
alloc.rs fix Layout struct member naming style 2022-04-11 13:35:18 +08:00
any.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
array.rs Stabilize core::array::from_fn 2022-05-20 11:04:13 -03:00
ascii.rs
asserting.rs [RFC 2011] Library code 2022-05-22 07:18:32 -03:00
atomic.rs
bool.rs
cell.rs Fix Display for cell::{Ref,RefMut} 2022-05-20 11:16:30 -07:00
char.rs Debug print char 0 as '\0' rather than '\u{0}' 2022-03-27 04:49:10 -07:00
clone.rs
cmp.rs Add test for StructuralEq for std::cmp::Ordering. 2022-03-16 14:01:48 -05:00
const_ptr.rs
convert.rs
future.rs
intrinsics.rs
lazy.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
lib.rs [RFC 2011] Library code 2022-05-22 07:18:32 -03:00
macros.rs
manually_drop.rs
mem.rs
nonzero.rs
ops.rs
option.rs
pattern.rs
pin_macro.rs
pin.rs
ptr.rs Extend ptr::null and null_mut to all thin (including extern) types 2022-05-13 18:03:06 +02:00
result.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
simd.rs Miri can run this test now 2022-03-03 14:54:18 -05:00
slice.rs Stage-step cfgs 2022-05-18 12:29:35 -04:00
str_lossy.rs
str.rs
task.rs
time.rs
tuple.rs
unicode.rs
waker.rs