about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2025-08-22modify `LazyLock` poison panic messageConnor Tsui-34/+59
Fixes an issue where if the underlying `Once` panics because it is poisoned, the panic displays the wrong message. Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
2025-08-22Stabilize `round_char_boundary` featureokaneco-6/+4
2025-08-22benchmarks for exponent fmt of integersPascal S. de Kloe-0/+24
2025-08-22improve float to_degrees/to_radians rounding comments and implKarol Zwolak-10/+79
* revise comments explaining why we are using literal or expression * add unspecified precision comments as we don't guarantee precision * use expression in `f128::to_degrees()` * make `f64::to_degrees()` impl consistent with other functions
2025-08-21Rollup merge of #145689 - cuviper:panic_unwind-cfg, r=joshtriplettJacob Pratt-14/+20
Migrate `panic_unwind` to use `cfg_select!` This follows rust-lang/rust#145489 with an additional place we can drop the `cfg-if` dependency.
2025-08-21Rollup merge of #145137 - Kmeakin:km/optimize-slice-index-panicking, r=jhprattJacob Pratt-102/+108
Consolidate panicking functions in `slice/index.rs` Consolidate all the panicking functions in `slice/index.rs` to use a single `slice_index_fail` function, similar to how it is done in `str/traits.rs`. Split off from https://github.com/rust-lang/rust/pull/145024
2025-08-21Rollup merge of #137494 - nabijaczleweli:dup, r=Mark-SimulacrumJacob Pratt-24/+26
libstd: init(): dup() subsequent /dev/nulls instead of opening them again This will be faster, and also it deduplicates the code so win/win The dup() is actually infallible here. But whatever. Before: ``` poll([{fd=0, events=0}, {fd=1, events=0}, {fd=2, events=0}], 3, 0) = 1 ([{fd=2, revents=POLLNVAL}]) openat(AT_FDCWD, "/dev/null", O_RDWR) = 2 rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f5749313050}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 poll([{fd=0, events=0}, {fd=1, events=0}, {fd=2, events=0}], 3, 0) = 2 ([{fd=0, revents=POLLNVAL}, {fd=2, revents=POLLNVAL}]) openat(AT_FDCWD, "/dev/null", O_RDWR) = 0 openat(AT_FDCWD, "/dev/null", O_RDWR) = 2 rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7efe12006050}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 poll([{fd=0, events=0}, {fd=1, events=0}, {fd=2, events=0}], 3, 0) = 3 ([{fd=0, revents=POLLNVAL}, {fd=1, revents=POLLNVAL}, {fd=2, revents=POLLNVAL}]) openat(AT_FDCWD, "/dev/null", O_RDWR) = 0 openat(AT_FDCWD, "/dev/null", O_RDWR) = 1 openat(AT_FDCWD, "/dev/null", O_RDWR) = 2 rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fc2dc7ca050}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 ``` After: ``` poll([{fd=0, events=0}, {fd=1, events=0}, {fd=2, events=0}], 3, 0) = 1 ([{fd=1, revents=POLLNVAL}]) openat(AT_FDCWD, "/dev/null", O_RDWR) = 1 rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f488a3fb050}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 poll([{fd=0, events=0}, {fd=1, events=0}, {fd=2, events=0}], 3, 0) = 2 ([{fd=1, revents=POLLNVAL}, {fd=2, revents=POLLNVAL}]) openat(AT_FDCWD, "/dev/null", O_RDWR) = 1 dup(1) = 2 rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f1a8943c050}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 poll([{fd=0, events=0}, {fd=1, events=0}, {fd=2, events=0}], 3, 0) = 3 ([{fd=0, revents=POLLNVAL}, {fd=1, revents=POLLNVAL}, {fd=2, revents=POLLNVAL}]) openat(AT_FDCWD, "/dev/null", O_RDWR) = 0 dup(0) = 1 dup(0) = 2 rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f4e3a4c7050}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0 ```
2025-08-21Introduce Reborrow lang item and traitAapo Alasuutari-0/+9
2025-08-21Merge pull request #1903 from folkertdev/s390x-llvm-21-fixesAmanieu d'Antras-93/+130
`s390x` llvm 21 improvements
2025-08-21Consolidate panicking functions in `slice/index.rs`Karl Meakin-102/+108
Consolidate all the panicking functions in `slice/index.rs` to use a single `slice_index_fail` function, similar to how it is done in `str/traits.rs`.
2025-08-21use `simd_saturating_{add, sub}` on neonFolkert de Vries-316/+48
2025-08-21Rollup merge of #145678 - ttajakka:master, r=estebankJacob Pratt-1/+1
Fix typo in docstring The return type is correct in the source code but incorrect in the docstring.
2025-08-21Rollup merge of #145673 - Berrysoft:cygwin-fix-flock, r=joshtriplettJacob Pratt-0/+10
Add flock support for cygwin See discussion: https://github.com/rust-lang/rust/issues/145534#issuecomment-3207265236 cc: ``@jeremyd2019``
2025-08-21Rollup merge of #145593 - RalfJung:unsafepinned-raw_get, r=Mark-SimulacrumJacob Pratt-2/+2
UnsafePinned::raw_get: sync signature with get This was forgotten in https://github.com/rust-lang/rust/pull/142162. Tracking issue: https://github.com/rust-lang/rust/issues/125735.
2025-08-21Rollup merge of #145525 - typesanitizer:vg/doc, r=Mark-SimulacrumJacob Pratt-1/+1
stdlib: Replace typedef -> type alias in doc comment 'typedef' is jargon from C and C++. Since the Rust reference uses the term [type alias](https://doc.rust-lang.org/reference/items/type-aliases.html), this patch changes the doc comment in io/error.rs to also use 'type alias'.
2025-08-21Rollup merge of #145415 - a4lg:riscv-implication-to-c, r=AmanieuJacob Pratt-1/+21
std_detect: RISC-V: implement implication to "C" Just like we implemented relatively complex rules to imply other extensions **from** "C" (and some others), this commit implements implication **to** the "C" extension from others, complying the following text in the ISA Manual (although there's no direct imply/depend references). > The C extension is the superset of the following extensions: > > - Zca > - Zcf if F is specified (RV32 only) > - Zcd if D is specified This is formally verified so that no other extension combinations (*not* in this implementation) can (currently) imply the "C" extension. Note: this is a `std_detect` change and not main target feature handling.
2025-08-21Rollup merge of #144758 - QnJ1c2kNCg:master, r=NoratriebJacob Pratt-6/+6
[Doc] Add links to the various collections Add a few links to the collections mentioned in the module doc for Collections.
2025-08-21Rollup merge of #143383 - fee1-dead-contrib:push-mstmlwuskxyy, r=dtolnayJacob Pratt-4/+4
stabilize `const_array_each_ref` cc rust-lang/rust#133289, needs FCP.
2025-08-20Diff-massaging commitltdk-87/+70
2025-08-20Move WTF-8 code from std to core/allocltdk-1278/+330
2025-08-20Copy WTF-8 code into core/alloc (for better diffs)ltdk-0/+1083
2025-08-20Migrate `panic_unwind` to use `cfg_select!`Josh Stone-14/+20
2025-08-20Merge pull request #1901 from folkertdev/wasm-read-unalignedAmanieu d'Antras-24/+14
wasm: use `{read, write}_unaligned` methods
2025-08-20Merge pull request #1899 from dpaoliello/arm64ecFolkert de Vries-12/+823
Add testing for Arm64EC Windows
2025-08-20s390x: link to a missed optimizationFolkert de Vries-0/+3
2025-08-20s390x: implement `vec_sld` using `fshl`Folkert de Vries-9/+46
2025-08-20s390x: implement `vec_subc_u128` using `overflowing_sub`Folkert de Vries-6/+4
2025-08-20s390x: implement `vec_mulo` using `core::intrinsics::simd`Folkert de Vries-36/+32
2025-08-20wasm: use `{read, write}_unaligned` methodsFolkert de Vries-24/+14
2025-08-20s390x: implement `vec_mule` using `core::intrinsics::simd`Folkert de Vries-38/+47
2025-08-20s390x: add `assert_instr` for `vec_extend`Folkert de Vries-6/+3
2025-08-20s390x: add `assert_instr` for `vec_round`Folkert de Vries-4/+2
2025-08-20s390x: define `unpack_low` using `core::intrinsics::simd`Folkert de Vries-9/+8
2025-08-20fix: typoTuomas Tajakka-1/+1
The return type is correct in the source code but incorrect in the docstring
2025-08-20Auto merge of #144086 - clubby789:alloc-zeroed, r=nikicbors-0/+1
Pass `alloc-variant-zeroed` to LLVM Makes use of https://github.com/llvm/llvm-project/pull/138299 (once we pull in a version of LLVM with this attribute). ~~Unfortunately also requires https://github.com/llvm/llvm-project/pull/149336 to work.~~ Closes rust-lang/rust#104847
2025-08-21Add flock support for cygwin王宇逸-0/+10
2025-08-20Pass `alloc-variant-zeroed` to LLVMclubby789-0/+1
2025-08-20Partial-stabilize the basics from `bigint_helper_methods`Scott McMurray-24/+42
2025-08-20Adjust immediate for vrndscalepd testsNikita Popov-2/+2
The immediate here encodes both the rounding mode (in the low bits) and the scale (in the high bits). Make sure the scale is non-zero.
2025-08-20Work around selection failure without avx512vlNikita Popov-4/+12
2025-08-20Add missing avx512vl target featuresNikita Popov-188/+188
2025-08-20Use intrinsics for some s390x operationsNikita Popov-3/+10
2025-08-20Drop no longer needed feature gatesNikita Popov-2/+0
2025-08-20Rollup merge of #145626 - folkertdev:prefetch-fallback, r=AmanieuJacob Pratt-16/+35
add a fallback implementation for the `prefetch_*` intrinsics related ACP: https://github.com/rust-lang/libs-team/issues/638 The fallback is to just ignore the arguments. That is a valid implementation because this intrinsic is just a hint. I also added the `miri::intrinsic_fallback_is_spec` annotation, so that miri now supports these operations. A prefetch intrinsic call is valid on any pointer. (specifically LLVM guarantees this https://llvm.org/docs/LangRef.html#llvm-prefetch-intrinsic) Next, I made the `LOCALITY` argument a const generic. That argument must be const (otherwise LLVM crashes), but that was not reflected in the type. Finally, with these changes, the intrinsic can be safe and `const` (a prefetch at const evaluation time is just a no-op). cc `@Amanieu` r? `@RalfJung`
2025-08-20Rollup merge of #145622 - tgross35:remove-builtins-patch, r=Mark-SimulacrumJacob Pratt-1/+0
Remove the std workspace patch for `compiler-builtins` All dependencies of `std` have dropped the crates.io dependency on `compiler-builtins`, so this patch is no longer needed. Closes: RUST-142265
2025-08-20Rollup merge of #145619 - joshtriplett:use-the-right-core, r=tgross35Jacob Pratt-4/+4
`std_detect`: Use `rustc-std-workspace-*` to pull in `compiler-builtins` https://github.com/rust-lang/rust/pull/145489 changed `std_detect` to no longer depend on `cfg-if`, which meant it no longer indirectly pulled in `rustc-std-workspace-core` via `cfg-if`. That caused it to no longer depend on `compiler-builtins`. Change `std_detect` to use `rustc-std-workspace-core` and `rustc-std-workspace-alloc`, to integrate with the rustc workspace. This also pulls in `compiler-builtins` via `rustc-std-workspace-core`. Closes: https://github.com/rust-lang/rust/issues/145594
2025-08-20Rollup merge of #145531 - sayantn:detect-apxf-avx10, r=AmanieuJacob Pratt-25/+47
Add runtime detection for APX-F and AVX10 This was missed in rust-lang/rust#139534 and rust-lang/rust#139675 `@rustbot` label O-x86_64 O-x86_32 A-target-feature r? `@Amanieu`
2025-08-20Rollup merge of #145417 - a4lg:riscv-arch-platform-guide-ch2, r=AmanieuJacob Pratt-83/+114
std_detect: RISC-V platform guide documentation This is practically a revert of a revert, making the commit e907456b2e10622ccd854a3bba8d02ce170b5dbb on `stdarch` come around again with minor fixes, enhancements and adjustments. An excerpt from the original commit message follows: Since there's no architectural feature detection on RISC-V (unlike `CPUID` on x86 architectures and some system registers on Arm/AArch64), runtime feature detection entirely depends on the platform-specific facility. As a result, availability of each feature heavily depends on the platform and its version. To help users make a decision for feature checking on a RISC-V system, this commit adds a platform guide with minimum supported platform versions.
2025-08-20Rollup merge of #145381 - Gnurou:int_lowest_highest_one, r=jhprattJacob Pratt-0/+321
Implement feature `int_lowest_highest_one` for integer and NonZero types Tracking issue: rust-lang/rust#145203 Implement the accepted ACP rust-lang/rust#145203 for methods that find the index of the least significant (lowest) and most significant (highest) set bit in an integer for signed, unsigned, and NonZero types. Also add unit tests for all these types.
2025-08-20Rollup merge of #145006 - ginnyTheCat:docs-skip-until, r=ibraheemdevJacob Pratt-2/+7
Clarify EOF handling for `BufRead::skip_until` This aligns `BufRead::skip_until`'s description more with `BufRead::read_until` in terms of how it handles EOF and extends the doctest to include this behavior.