rust/library/coretests/tests
Trevor Gross fcb9da597a
Rollup merge of #137280 - RalfJung:const_swap_nonoverlapping, r=lcnr
stabilize ptr::swap_nonoverlapping in const

Closes https://github.com/rust-lang/rust/issues/133668

The blocking issue mentioned there is resolved by documentation. We may in the future actually support such code, but that is blocked on https://github.com/rust-lang/const-eval/issues/72 which is non-trivial to implement. Meanwhile, this completes stabilization of all `const fn` in `ptr`. :)

Here's a version of the problematic example to play around with:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=6c390452379fb593e109b8f8ee854d2a

Should be FCP'd with both `@rust-lang/libs-api`  and `@rust-lang/lang`  since  `swap_nonoverlapping` is documented to work as an "untyped" operation but due to the limitation mentioned above, that's not entirely true during const evaluation. I expect this limitation will only be hit in niche corner cases, so the benefits of having this function work most of the time outweigh the downsides of users running into this problem. (Note that unsafe code could already hit this limitation before this PR by doing cursed pointer casts, but having it hidden inside `swap_nonoverlapping` feels a bit different.)
2025-05-04 18:11:47 -04:00
..
async_iter Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
ffi Move <CStr as Debug> test to coretests 2025-04-18 10:31:55 -04:00
fmt Auto merge of #136974 - m-ou-se:fmt-options-64-bit, r=scottmcm 2025-03-22 10:56:14 +00:00
hash library: Use size_of from the prelude instead of imported 2025-03-06 20:20:38 -08:00
io Migrate coretests to Rust 2024 2025-02-13 13:10:21 -08:00
iter added test for Enumerate::next_index on empty iterator 2025-04-19 12:29:47 +02:00
net Recognise new IPv6 non-global range from RFC9602 2025-03-21 17:53:29 +11:00
num coretests stop relying on inline_const_pat 2025-03-21 09:35:31 +01:00
ops Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
panic Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
alloc.rs library: Use size_of from the prelude instead of imported 2025-03-06 20:20:38 -08:00
any.rs Optionally add type names to TypeIds. 2025-02-11 18:42:19 -08:00
array.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
ascii.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
ascii_char.rs Implement Extend<AsciiChar> for String 2025-02-08 16:51:04 -05:00
asserting.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
atomic.rs library: Use size_of from the prelude instead of imported 2025-03-06 20:20:38 -08:00
bool.rs Remove some unnecessary parens in assert! conditions 2025-02-06 22:28:44 +00:00
bstr.rs Actually run the bstr test 2025-01-26 10:45:09 +00:00
cell.rs Apply requested API changes to cell_update 2025-04-02 18:18:50 +00:00
char.rs add MAX_LEN_UTF8 and MAX_LEN_UTF16 constants 2025-02-16 21:08:38 +08:00
clone.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
cmp.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
const_ptr.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
convert.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
error.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
ffi.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
future.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
hint.rs Fix drop handling in hint::select_unpredictable 2025-04-17 17:30:53 +02:00
intrinsics.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
lazy.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
lib.rs Rollup merge of #137280 - RalfJung:const_swap_nonoverlapping, r=lcnr 2025-05-04 18:11:47 -04:00
macros.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
manually_drop.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
mem.rs Add inherent versions of MaybeUninit::fill methods for slices 2025-03-08 18:41:35 -05:00
nonzero.rs library: Use size_of from the prelude instead of imported 2025-03-06 20:20:38 -08:00
ops.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
option.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
panic.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
pattern.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
pin.rs Put pin!() tests in the right file. 2025-03-28 10:18:04 +01:00
pin_macro.rs Implement pin!() using super let. 2025-04-15 11:14:21 +02:00
ptr.rs stabilize ptr::swap_nonoverlapping in const 2025-04-29 10:40:56 +02:00
result.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
simd.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
slice.rs Rollup merge of #138034 - thaliaarchi:use-prelude-size-of, r=tgross35 2025-03-07 10:12:44 +01:00
str.rs tidy: Fix paths to coretests and alloctests 2025-04-05 12:15:49 -07:00
str_lossy.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
task.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
time.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
tuple.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
unicode.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
waker.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00