rust/library
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
..
alloc Auto merge of #140188 - nnethercote:streamline-format-macro, r=cuviper 2025-04-30 04:04:21 +00:00
alloctests Suggest {to,from}_ne_bytes for transmutations between arrays and integers, etc 2025-04-24 13:14:36 +07:00
backtrace@9d2c34e7e6 Update backtrace 2025-02-13 14:32:50 -08:00
core Rollup merge of #137280 - RalfJung:const_swap_nonoverlapping, r=lcnr 2025-05-04 18:11:47 -04:00
coretests Rollup merge of #137280 - RalfJung:const_swap_nonoverlapping, r=lcnr 2025-05-04 18:11:47 -04:00
panic_abort Migrate panic_abort to Rust 2024 2025-03-11 09:46:34 -07:00
panic_unwind update cfgs 2025-04-09 12:29:59 +01:00
portable-simd Merge commit 'c14f2fc3eb' into sync-from-portable-simd-2025-03-19 2025-03-19 00:58:47 -04:00
proc_macro Stabilize proc_macro::Span::{start, end, line, column}. 2025-04-15 17:29:04 +02:00
profiler_builtins Fix profiler_builtins build script to handle full path to profiler lib 2025-04-11 16:57:38 +02:00
rtstartup Revert changes for rtstartup 2025-03-10 21:23:31 +08:00
rustc-std-workspace-alloc Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
rustc-std-workspace-core Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
rustc-std-workspace-std Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
std Rollup merge of #140595 - lolbinarycat:std-set_permissions-typo, r=cuviper 2025-05-03 12:44:36 +02:00
stdarch@f1c1839c0d Update stdarch 2025-05-01 20:01:43 +05:30
sysroot Update stdarch 2025-05-01 20:01:43 +05:30
test Remove backticks from ShouldPanic::YesWithMessage's TrFailedMsg 2025-04-28 21:40:29 +02:00
unwind unwind: bump unwinding dependency to 0.2.6 2025-04-29 09:46:32 +08:00
windows_targets Migrate windows-targets to Rust 2024 2025-03-11 09:46:35 -07:00
Cargo.lock Rollup merge of #140422 - betrusted-io:bump-unwinding-to-0.2.6, r=workingjubilee 2025-04-29 12:28:24 -04:00
Cargo.toml Add opt-level = "s" for more std symbolication crates 2025-04-01 20:50:19 +00:00