about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2025-07-25Allow ffi_unwind_calls for `arch::wasm32::throw`Alisa Sireneva-0/+10
2025-07-25std/sys/fd: remove `- 1` from `READ_LIMIT` on Darwinmorinmorin-3/+3
Darwin's `read`/`write` syscalls emit `EINVAL` only when `nbyte > INT_MAX`. The case `nbyte == INT_MAX` is valid, so the subtraction can be removed.
2025-07-25fmt benchmarks for binary, octal and hexPascal S. de Kloe-0/+180
2025-07-25fmt of non-decimals is always non-negative due to the two's-complement outputPascal S. de Kloe-40/+48
2025-07-25Merge pull request #1879 from heiher/loong-simd-unified-typesFolkert de Vries-4522/+4780
loongarch: Use unified data types for SIMD intrinsics
2025-07-25Link to Mutex poisoning docs from RwLock docsAlisa Sireneva-1/+3
2025-07-25Rollup merge of #144314 - kornelski:pivot-safely, r=jhprattMatthias Krüger-10/+10
Hint that choose_pivot returns index in bounds Instead of using `unsafe` in multiple places, one `hint::assert_unchecked` allows use of safe code instead. Part of #rust-lang/rust#144326
2025-07-25Rollup merge of #143970 - SunkenPotato:update_mem_copy_docs, r=scottmcmMatthias Krüger-1/+1
Update core::mem::copy documentation Update the documentation of `core::mem::copy` to include a `const` on the definition of the function.
2025-07-25Rollup merge of #143424 - hkBst:auto-deref, r=jhprattMatthias Krüger-7/+7
clippy fix: rely on autoderef Changes instances of `&**self` to `self`.
2025-07-25loongarch: Use unified data types for SIMD intrinsicsWANG Rui-4522/+4780
2025-07-24library/windows_targets: Fix macro expansion error in 'link' macroIvan Tadeu Ferreira Antunes Filho-13/+3
A recent change altered the definition of the link! macro when the windows_raw_dylib feature is enabled, changing its syntax from pub macro {..} to pub macro($tt:tt) {..} in #143592 This change introduced a build failure with the error: "macros that expand to items must be delimited with braces or followed by a semicolon". We add a semicolon to the line causing the issue as we also modify the non windows_raw_dylib link to make use of the link_dylib macro
2025-07-24Use `x86_no_sse` configuration in more placesTrevor Gross-17/+16
Emit `x86_no_sse` in the compiler-builtins (and builtins-test) build script, and use it to simplify `all(target_arch = "x86", not(target_fefature = "sse))` configuration.
2025-07-24Enable skipped `f32` and `f64` multiplication testsTrevor Gross-4/+0
The fix has since made it to nightly, so the skips here can be removed.
2025-07-24Enable tests that were skipped on aarch64Trevor Gross-9/+0
The LLVM issue was resolved a while ago, these should no longer be a problem.
2025-07-24Rollup merge of #144278 - Qelxiros:rev-into-inner, r=tgross35León Orell Valerian Liehr-0/+19
add Rev::into_inner Tracking issue: rust-lang/rust#144277
2025-07-24Rollup merge of #144247 - RalfJung:ldexp, r=tgross35León Orell Valerian Liehr-32/+38
coretests/num: use ldexp instead of hard-coding a power of 2 r? `````@tgross35`````
2025-07-24Rollup merge of #143838 - Ayush1325:uefi-tcp4-config-data, r=tgross35León Orell Valerian Liehr-15/+81
std: net: uefi: Add support to query connection data - Use EFI_TCP4_GET_MODE_DATA to be able to query for ttl, nodelay, peer_addr and socket_addr. - peer_addr is needed for implementation of `accept`. - cc `````@nicholasbishop````` - Also a heads up. The UEFI spec seems to be wrong or something for [EFI_TCP4_CONFIG_DATA](https://uefi.org/specs/UEFI/2.11/28_Network_Protocols_TCP_IP_and_Configuration.html#efi-tcp4-protocol-getmodedata). `ControlOption` should be a pointer as seen in [edk2](https://github.com/tianocore/edk2/blob/a1b509c1a453815acbc6c8b0fc5882fd03a6f2c0/MdePkg/Include/Protocol/Tcp4.h#L97).
2025-07-24std_detect testing improvementsbjorn3-3/+3
* Fix riscv testing. Previously the mod tests; would be looking for src/detect/os/tests.rs. * Replace a test with an unnamed const item. It is testing that no warnings are emitted. It doesn't contain any checks that need to run at runtime. Replacing the test allows removing the tidy:skip directive for test locations.
2025-07-24Add non-temporal note for maskmoveu_si128Aurelia Molzer-1/+10
Like any other non-temporal instructions this has additional safety requirements due to the mismatch with the Rust memory model. It is vital to know when using this instruction.
2025-07-24Enable tests that were skipped on PowerPCTrevor Gross-120/+34
Most of these were skipped because of a bug with the platform implementation, or some kind of crash unwinding. Since the upgrade to Ubuntu 25.04, these all seem to be resolved with the exception of a bug in the host `__floatundisf` [1]. [1] https://github.com/rust-lang/compiler-builtins/pull/384#issuecomment-740413334
2025-07-24ci: Upgrade ubuntu:25.04 for the PowerPC64LE testTrevor Gross-3/+1
Update the last remaining image. For this to work, the `QEMU_CPU=POWER8` configuration needed to be dropped to avoid a new SIGILL. Doing some debugging locally, the crash comes from an `extswsli` (per `powerpc:common64` in gdb-multiarch) in the `ld64.so` available with PowerPC, which qemu rejects when set to power8. Testing a build with `+crt-static` hits the same issue at a `maddld` in `__libc_start_main_impl`. Rust isn't needed to reproduce this: $ cat a.c #include <stdio.h> int main() { printf("Hello, world!\n"); } $ powerpc64le-linux-gnu-gcc a.c $ QEMU_CPU=power8 QEMU_LD_PREFIX=/usr/powerpc64le-linux-gnu/ ./a.out qemu: uncaught target signal 4 (Illegal instruction) - core dumped Illegal instruction So the cross toolchain provided by Debian must have a power9 baseline rather than rustc's power8. Alternatively, qemu may be incorrectly rejecting these instructions (I can't find a source on whether or not they should be available for power8). Testing instead with the `-musl` toolchain and ppc linker from musl.cc works correctly. In any case, things work with the default qemu config so it seems fine to drop. The env was originally added in 5d164a4edafb ("fix the powerpc64le target") but whatever the problem was there appears to no longer be relevant.
2025-07-24Disable unit tests for stdlib packages that don't contain anybjorn3-0/+16
2025-07-24ci: Use a mirror for muslTrevor Gross-1/+1
We pretty often get at least one job failed because of failure to pull the musl git repo. Switch this to the unofficial mirror [1] which should be more reliable. Link: https://github.com/kraj/musl [1]
2025-07-24symcheck: Switch the `object` dependency from git to crates.ioTrevor Gross-2/+1
Wasm support has since been released, so we no longer need to depend on a git version of `object`.
2025-07-24ci: Update to the latest ubuntu:25.04 Docker imagesTrevor Gross-20/+21
This includes a qemu update from 8.2.2 to 9.2.1 which should hopefully fix some bugs we have encountered. PowerPC64LE is skipped for now because the new version seems to cause a number of new SIGILLs.
2025-07-23add Rev::into_innerJeremy Smart-0/+19
2025-07-23Document (internally) that `Range*<&T> as RangeBounds<T>` impls are ↵Zachary S-0/+48
intentionally not `T: ?Sized`, and document (publically) an alternative.
2025-07-23Update `dlmalloc` dependency of libstdAlex Crichton-3/+3
This primarily pulls in alexcrichton/dlmalloc-rs/55 and alexcrichton/dlmalloc-rs/54 to address 144199. Notably the highest byte in the wasm address space is no longer allocatable and additionally the allocator internally uses `wrapping_add` instead of `add` on pointers since on 32-bit platforms offsets might be larger than half the address space.
2025-07-23coretests/num: use ldexp instead of hard-coding a power of 2Ralf Jung-32/+38
2025-07-23Rollup merge of #144234 - roblabla:fix-win7-tls-dtors, r=ChrisDentonMatthias Krüger-3/+14
Fix broken TLS destructors on 32-bit win7 Fixes rust-lang/rust#141300 On the 32-bit win7 target, we use OS TLS instead of native TLS, due to issues with how the OS handles alignment. Unfortunately, this caused issues due to the TLS destructors not running, causing memory leaks among other problems. On Windows, to support OS TLS, the TlsAlloc family of function is used by Rust. This function does not support TLS destructors at all. However, rust has some code to emulate those destructors, by leveraging the TLS support functionality found in the MSVC CRT (specifically, in tlssup.c of the CRT). To use this functionality, the user must do two things: 1. They must put the address to their callback in a section between `.CRT$XLB` and `.CRT$XLY`. 2. They must add a reference to `_tls_used` (or `__tls_used` on x86) to make sure the TLS support code in tlssup.c isn't garbage collected by the linker. Prior to this commit, this second bit wasn't being done properly by the Rust TLS support code. Instead of adding a reference to _tls_used, it instead had a reference to its own callback to prevent it from getting GC'd by the linker. While this is _also_ necessary, not having a reference on _tls_used made the entire support non-functional. This commit reworks the code to: 1. Add an unconditional `#[used]` attribute on the CALLBACK, which should be enough to prevent it from getting GC'd by the linker. 2. Add a reference to `_tls_used`, which should pull the TLS support code into the Rust programs and not let it be GC'd by the linker.
2025-07-23Reformat codeJakub Beránek-5/+1
2025-07-23Merge ref '5a30e4307f05' from rust-lang/rustJakub Beránek-3383/+2822
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 5a30e4307f0506bed87eeecd171f8366fdbda1dc Filtered ref: 59749e9f8c765d3021796a9fe0c188643c4b8d77 This merge was created using https://github.com/rust-lang/josh-sync.
2025-07-23Prepare for merging from rust-lang/rustJakub Beránek-1/+1
This updates the rust-version file to 5a30e4307f0506bed87eeecd171f8366fdbda1dc.
2025-07-23Add regression test for matches! + non_exhaustive_omitted_patterns lintJonas Platte-0/+7
2025-07-23Disable non_exhaustive_omitted_patterns within matches! macroJonas Platte-0/+2
2025-07-23Hint that choose_pivot returns index in boundsKornel-10/+10
2025-07-23Auto merge of #143412 - Kobzol:std-detect-in-stdlib, r=Amanieubors-805/+363
Move `std_detect` into stdlib This PR moves the `std_detect` crate from `stdarch` to be a part of rust-lang/rust instead. The first commit actually moves the whole directory from the stdarch Josh subtree, so that git blame history is kept intact. Then I had to make a few changes to appease `tidy`. The most complex thing here is porting the tests. We can't have `std_detect` both in r-l/r and stdarch, because they could get desynchronized, so we have to perform the move more or less "atomically", which means that we also have to port all the existing `std_detect` tests from the `stdarch` repository. The stdarch repo runs the following `std_detect` tests: ### Build The `build-std-detect.sh` script (https://github.com/rust-lang/stdarch/blob/e2b6512aed87df45294ae680181eeef7a802cd95/ci/build-std-detect.sh) builds `std_detect` using the nightly compiler for several targets. This will be subsumed by normal `x build library` on our Tier 1/2 targets. However, the stdarch repository also tests the following targets: - aarch64-unknown-freebsd - armv6-unknown-freebsd - powerpc-unknown-freebsd - powerpc64-unknown-freebsd - aarch64-unknown-openbsd Which we don't build/test on our CI currently. I think we have mostly two options here: 1) Ignore these targets 2) Create a special CI job that will build stage 1 rustc and then cross-compile std (or just the `std_detect` crate?) for these targets. ### Documentation The `dox.sh` script (https://github.com/rust-lang/stdarch/blob/3fec5adcd52a815f227805d4959a25b6402c7fd5/ci/dox.sh) builds and documents `std_detect` for several targets. All of them are Tier 2/we have `dist-` jobs for them, so I think that we can just skip this and let our normal CI subsume it? ### Tests The `run.sh` script (https://github.com/rust-lang/stdarch/blob/1b201cec2cca7465602a65ed6ae60517224b15f3/ci/run.sh) runs `cargo test` on `std_detect` with a bunch of variations of feature flags. This will be subsumed by `x test library` in our CI. The only problem is that `stdarch` runs these tests for a ludicrous number of targets: ``` - tuple: i686-unknown-linux-gnu - tuple: x86_64-unknown-linux-gnu - tuple: arm-unknown-linux-gnueabihf - tuple: armv7-unknown-linux-gnueabihf - tuple: aarch64-unknown-linux-gnu - tuple: aarch64_be-unknown-linux-gnu - tuple: riscv32gc-unknown-linux-gnu - tuple: riscv64gc-unknown-linux-gnu - tuple: powerpc-unknown-linux-gnu - tuple: powerpc64-unknown-linux-gnu - tuple: powerpc64le-unknown-linux-gnu - tuple: s390x-unknown-linux-gnu - tuple: i586-unknown-linux-gnu - tuple: nvptx64-nvidia-cuda - tuple: thumbv6m-none-eabi - tuple: thumbv7m-none-eabi - tuple: thumbv7em-none-eabi - tuple: thumbv7em-none-eabihf - tuple: loongarch64-unknown-linux-gnu - tuple: wasm32-wasip1 - tuple: x86_64-apple-darwin - tuple: x86_64-apple-ios-macabi - tuple: aarch64-apple-darwin - tuple: aarch64-apple-ios-macabi - tuple: x86_64-pc-windows-msvc - tuple: i686-pc-windows-msvc - tuple: aarch64-pc-windows-msvc - tuple: x86_64-pc-windows-gnu - tuple: aarch64-unknown-linux-gnu - tuple: aarch64_be-unknown-linux-gnu - tuple: armv7-unknown-linux-gnueabihf - tuple: loongarch64-unknown-linux-gnu - tuple: powerpc-unknown-linux-gnu - tuple: powerpc64-unknown-linux-gnu - tuple: powerpc64le-unknown-linux-gnu - tuple: riscv32gc-unknown-linux-gnu - tuple: riscv64gc-unknown-linux-gnu - tuple: s390x-unknown-linux-gnu - tuple: x86_64-unknown-linux-gnu - tuple: aarch64-apple-darwin - tuple: aarch64-apple-ios-macabi ``` We definitely do not run *tests* for all of these targets on our CI. # Outcome We have decided to just subsume std_detect tests by our normal test suite for now, and not create a separate CI job. Therefore, this PR performs the following changes in target testing for `std_detect`: The following T3 targets would go from "build" to "nothing": ``` aarch64-unknown-freebsd (T3) armv6-unknown-freebsd (T3) powerpc-unknown-freebsd (T3) powerpc64-unknown-freebsd (T3) aarch64-unknown-openbsd (T3) ``` The following T3 targets would go from "test" to "nothing": ``` aarch64_be-unknown-linux-gnu (T3) riscv32gc-unknown-liux-gnu (T3) ``` The following T2 targets would go from "test" to "build": ``` arm-unknown-linux-gnueabihf (T2) armv7-unknown-linux-gnueabihf (T2) riscv64gc-unknown-linux-gnu (T2) powerpc-unknown-linux-gnu (T2) powerpc64-unknown-linux-gnu (T2) powerpc64le-unknown-linux-gnu (T2) s390x-unknown-linux-gnu (T2) i586-unknown-linux-gnu (T2) loongarch64-unknown-linux-gnu (T2) wasm32-wasip1 (T2) x86_64-apple-ios-macabi (T2) aarch64-apple-ios-macabi (T2) aarch64-pc-windows-msvc (T2) armv7-unknown-linux-gnueabihf (T2) loongarch64-unknown-linux-gnu (T2) powerpc-unknown-linux-gnu (T2) ``` I have confirmed in https://github.com/rust-lang/stdarch/pull/1873 that the current version of this PR would pass stdarch's CI testsuite. r? `@ghost` try-job: armhf-gnu try-job: arm-android
2025-07-23ci: Add native PowerPC64LE and s390x jobsTrevor Gross-0/+22
We now have access to native runners, so make use of them for these architectures. The existing ppc64le Docker job is kept for now.
2025-07-23bump serde_with. Weird that it works without std feature, butklensy-39/+23
2025-07-23remove unused depsklensy-25/+0
2025-07-23atomicrmw on pointers: move integer-pointer cast hacks into backendRalf Jung-62/+57
2025-07-23std: net: uefi: Add support to query connection dataAyush Singh-15/+81
- Use EFI_TCP4_GET_MODE_DATA to be able to query for ttl, nodelay, peer_addr and socket_addr. - peer_addr is needed for implementation of `accept`. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-07-23add links to collectionsgewitternacht-0/+5
2025-07-23remove trailing whitespacegewitternacht-1/+1
2025-07-22document assumptions about `Clone` and `Eq` traitsgewitternacht-0/+24
2025-07-22Auto merge of #144249 - GuillaumeGomez:asm-tests, r=jieyouxubors-2/+2
Rename `tests/{assembly,codegen}` into `tests/{assembly,codegen}-llvm` and ignore these testsuites if configured backend doesn't match Follow-up of https://github.com/rust-lang/rust/pull/144125. This PR changes `compiletest` so that `asm` tests are only run if they match the current codegen backend. To better reflect it, I renamed the `tests/ui/asm` folder into `tests/ui/asm-llvm`. Like that, we can add new asm tests for other backends if we want without needing to add extra code to `compiletest`. Next step will be to use the new code annotations added in rust-lang/rust#144125 to ignore ui tests failing in cg_gcc until it's fixed on our side. cc `@antoyo` `@oli-obk` r? `@Kobzol`
2025-07-22Embed auxv files directly into the test binaryJakub Beránek-12/+10
2025-07-22Improve error messages of auxv loadingJakub Beránek-10/+17
2025-07-22Remove licenses from std-detectJakub Beránek-226/+0
They are subsumed by the main repo licenses.
2025-07-22Remove `std_detect` from stdarch's CIJakub Beránek-71/+2