about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2025-09-12Rollup merge of #146433 - RalfJung:rwlock-miri, r=tgross35Stuart Cook-3/+3
rwlock tests: fix miri macos test regression https://github.com/rust-lang/rust/pull/144648 broke the attributes that ignore the tests on Miri; this patch should fix that.
2025-09-12Rollup merge of #146432 - hermit-os:hermit-take_error, r=joboetStuart Cook-2/+3
Implement `Socket::take_error` for Hermit This PR fixes an unused-imports compilation error introduced in 845311a065a5638c516ed96c73b09862b176b329 and implements `Socket::take_error` for Hermit. Hermit's `Socket::take_error` implementation works exactly like the one for Unix. r? joboet
2025-09-12Rollup merge of #146323 - h3fang:issue-146230-fix, r=AmanieuStuart Cook-33/+44
check before test for hardware capabilites in bits 32~63 of usize This commit tries to fix https://github.com/rust-lang/rust/issues/146230. `std::arch::is_aarch64_feature_detected` panics on aarch64 ILP32 targets. After some digging, the real problem is https://github.com/rust-lang/rust/blob/91edc3ebccc4daa46c20a93f4709862376da1fdd/library/std_detect/src/detect/os/linux/aarch64.rs#L210-L241 checks bits 32~63 of usize unconditionally on normal aarch64 LP64 target and aarch64 ILP32 target. Here I propose to move these to a block guarded by `#[cfg(target_pointer_width="64")]`. See rust-lang/rust#146230 for more detailed analysis. r? ```@Amanieu```
2025-09-12Rollup merge of #145895 - RalfJung:unpark, r=joboetStuart Cook-16/+59
thread parking: fix docs and examples Fixes https://github.com/rust-lang/rust/issues/145816 r? ```@joboet``` Cc ```@m-ou-se``` ```@Amanieu```
2025-09-12fix typo in commentFang He-1/+1
2025-09-11Auto merge of #145177 - joboet:move-pal-thread, r=ibraheemdevbors-1097/+897
std: move `thread` into `sys` Part of https://github.com/rust-lang/rust/issues/117276.
2025-09-11rwlock tests: fix miri macos test regressionRalf Jung-3/+3
2025-09-11Implement `Socket::take_error` for HermitMartin Kröning-1/+2
2025-09-11Remove unused import from sys/pal/hermit/os.rsMartin Kröning-1/+1
This fixes ``` error: unused import: `str` --> library/std/src/sys/pal/hermit/os.rs:6:22 | 6 | use crate::{fmt, io, str}; | ^^^ | = note: `-D unused-imports` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(unused_imports)]` ``` This was caused by 845311a065a5638c516ed96c73b09862b176b329.
2025-09-11Rollup merge of #146425 - ferrocene:pvdrz/improve-array-coverage, ↵Stuart Cook-0/+7
r=workingjubilee Improve `core::array` coverage This PR improves the `core::array` coverage by adding new tests to `coretests`
2025-09-11Rollup merge of #146424 - ferrocene:pvdrz/improve-ops-coverage, r=workingjubileeStuart Cook-1/+75
Improve `core::ops` coverage This PR improves the `core::ops` coverage by adding new tests to `coretests`
2025-09-11Rollup merge of #146380 - rperier:unify_and_dedup_bits_conv_float_tests, ↵Stuart Cook-110/+63
r=tgross35 Unify and deduplicate bits conv float tests cc rust-lang/rust#141726 This is a proposal to unify and deduplicate the bits conv tests for f16, f32, f64 and f128
2025-09-11Rollup merge of #146379 - madsmtm:fix-platform_version-test, r=tgross35Stuart Cook-3/+3
Fix `compare_against_sw_vers` test The `saturating_sub` doesn't actually perform its intended since the version numbers are signed integers (which I changed in a later revision of https://github.com/rust-lang/rust/pull/138944). Fixes the issue described in https://github.com/rust-lang/rust/pull/138944#issuecomment-3270662876. r? tgross35
2025-09-11Rollup merge of #142315 - lolbinarycat:core-dedup-ptr-docs-139190-pt3, ↵Stuart Cook-134/+111
r=workingjubilee core::ptr: deduplicate docs for as_ref, addr, and as_uninit_ref also add INFO.md file explaining the purpose of the ptr/docs dir, and give some pointers (heh) to future maintainers. follow up to rust-lang/rust#142101 part of rust-lang/rust#139190 r? `@workingjubilee`
2025-09-10Improve `core::array` coverageChristian Poveda-0/+7
2025-09-10Update library/coretests/tests/ops.rsChristian Poveda Ruiz-1/+2
Co-authored-by: Jubilee <workingjubilee@gmail.com>
2025-09-10Improve `core::ops` coverageChristian Poveda-1/+74
2025-09-10Rollup merge of #146322 - weiznich:fix/146087, r=joboetMatthias Krüger-0/+13
Make Barrier RefUnwindSafe again This commit manually implements `RefUnwindSafe` for `std::sync::Barrier` to fix rust-lang/rust#146087. This is a fix for a regression indroduced by https://github.com/rust-lang/rust/commit/e95db591a4550e28ad92660b753ad85b89271882
2025-09-10Rollup merge of #145327 - joboet:net-addr-sgx-hack, r=tgross35Matthias Krüger-216/+276
std: make address resolution weirdness local to SGX Currently, the implementations of `TcpStream::connect` and its cousins take an `io::Result<&SocketAddr>` as argument, which is very weird, as most of them then `?`-try the result immediately to access the actual address. This weirdness is however necessitated by a peculiarity of the SGX networking implementation: SGX doesn't support DNS resolution but rather accepts hostnames in the same place as socket addresses. So, to make e.g. ```rust TcpStream::connect("example.com:80")` ``` work, the DNS lookup returns a special error (`NonIpSockAddr`) instead, which contains the hostname being looked up. When `.to_socket_addrs()` fails, the `each_addr` function used to select an address will pass the error to the inner `TcpStream::connect` implementation, which in SGX's case will inspect the error and try recover the hostname from it. If that succeeds, it continues with the found hostname. This is pretty obviously a terrible hack and leads to buggy code (for instance, when users use the result of `.to_socket_addrs()` in their own `ToSocketAddrs` implementation to select from a list of possible URLs, the only URL used will be that of the last item tried). Still, without changes to the SGX usercall ABI, it cannot be avoided. Therefore, this PR aims to minimise the impact of that weirdness and remove it from all non-SGX platforms. The inner `TcpStream::connect`, et al. functions now receive the `ToSocketAddrs` type directly and call `each_addr` (which is moved to `sys::net::connection`) themselves. On SGX, the implementation uses a special `each_addr` which contains the whole pass-hostname-through-error hack. As well as making the code cleaner, this also opens up the possibility of reusing newly created sockets even if a connection request fails – but I've left that for another PR. CC `@raoulstrackx`
2025-09-10core::ptr: deduplicate docs for as_ref, addr, and as_uninit_refbinarycat-134/+111
also add INFO.md file explaining the purpouse of the ptr/docs dir.
2025-09-10std: move `thread` into `sys`joboet-1042/+842
2025-09-10Unify and deduplicate bits conv float testsRomain Perier-110/+63
2025-09-10Rollup merge of #144765 - Qelxiros:range-inclusive-last, r=jhprattMatthias Krüger-26/+169
inclusive `Range`s: change `end` to `last` Tracking issue: rust-lang/rust#125687 ACP: rust-lang/libs-team#511
2025-09-10Add suggestionsGeorg Semmler-3/+2
2025-09-09Fix compare_against_sw_vers test when a version part is 0Mads Marquart-3/+3
2025-09-09Rollup merge of #146366 - LorrensP-2158466:miri-gamma, r=RalfJungMatthias Krüger-5/+5
add approx_delta to all gamma tests f32::gamma tests are less precise in CI, so we increase the tolerance for these tests. See [#miri > Miri test-libstd Failure (2025-09) @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/269128-miri/topic/Miri.20test-libstd.20Failure.20.282025-09.29/near/538138742) r? `@RalfJung`
2025-09-09Rollup merge of #146001 - bjorn3:update_getopts, r=davidtwcoMatthias Krüger-14/+3
Update getopts to remove unicode-width dependency Pulls in https://github.com/rust-lang/getopts/pull/133. This saves 1.5MB on the vendored size of the standard library.
2025-09-09Make the compile test use a const insteadGeorg Semmler-8/+7
2025-09-09Make Barrier RefUnwindSafe againGeorg Semmler-0/+15
This commit manually implements `RefUnwindSafe` for `std::sync::Barrier` to fix 146087. This is a fix for a regression indroduced by https://github.com/rust-lang/rust/commit/e95db591a4550e28ad92660b753ad85b89271882
2025-09-09add approx_delta to all gamma testsLorrensP-2158466-5/+5
2025-09-09Rollup merge of #146343 - madsmtm:fix-platform_version, r=tgross35Stuart Cook-3/+8
Weakly export `platform_version` symbols The symbols `__isPlatformVersionAtLeast` and `__isOSVersionAtLeast`. This should allow linking both `compiler-rt` and `std`, which fixes https://github.com/rust-lang/rust/pull/138944#issuecomment-3266574582. r? tgross35 CC ``@zmodem,`` could you please verify that this works for you?
2025-09-09Rollup merge of #146326 - cyrgani:int-module-1, r=jhprattStuart Cook-219/+81
simplify the declaration of the legacy integer modules (`std::u32` etc.) This PR removes some duplicated code from the declaration of the legacy integer modules by expanding the macro which is already used to generate `MIN` and `MAX` to now generate the whole module. This would also make the remaining steps listed in rust-lang/rust#68490 such as fully deprecating the modules or placing `#[doc(hidden)]` on them easier.
2025-09-09Rollup merge of #146324 - RalfJung:no-ptr-fragment, r=oli-obkStuart Cook-5/+42
const-eval: disable pointer fragment support This fixes https://github.com/rust-lang/rust/issues/146291 by disabling pointer fragment support for const-eval. I want to properly fix this eventually, but won't get to it in the next few weeks, so this is an emergency patch to prevent the buggy implementation from landing on stable. The beta cutoff is on Sep 12th so if this PR lands after that, we'll need a backport.
2025-09-09Rollup merge of #146314 - cyrgani:hide-fmt-args-nl, r=GuillaumeGomezStuart Cook-0/+1
mark `format_args_nl!` as `#[doc(hidden)]` The `#[unstable]` attribute of the macro already says: > `format_args_nl` is only for internal language use and is subject to change It does seem plausible to hide it from the `std` docs accordingly. The PR also removes the single usage of the macro outside of `std` as it does not seem like the macro is actually needed there.
2025-09-09Rollup merge of #146300 - bjoernager:f16-f128-sum-product, r=jhprattStuart Cook-1/+1
Implement `Sum` and `Product` for `f16` and `f128`. Tracking issue: rust-lang/rust#116909. This PR implements `core::iter::{Sum, Product}` for `f16` and `f128`. I'm curious as to why these two traits aren't already implemented. I've been unable to find any information about it at all, so if there is anything that currently blocks them, I would appreciate if someone could fill me in.
2025-09-08change end to lastJeremy Smart-26/+169
2025-09-08simplify the declaration of the legacy integer modules (`std::u32` etc.)cyrgani-219/+81
2025-09-08Weakly export platform_version symbolsMads Marquart-0/+5
The symbols __isPlatformVersionAtLeast and __isOSVersionAtLeast. This allows the user to link both compiler_rt and std.
2025-09-08Reorder test to make failures clearerMads Marquart-3/+3
2025-09-08std: move `thread` into `sys` (rename only)joboet-0/+0
2025-09-08std: make address resolution weirdness local to SGXjoboet-216/+276
2025-09-08Rollup merge of #146319 - justinyaodu:patch-1, r=jhprattMatthias Krüger-1/+1
Fix typo in default.rs This sentence currently reads: > Rust implements `Default` for various primitives types. I think it should just be "primitive types".
2025-09-08Rollup merge of #146299 - smirzaei:doc/improve-path-canonicalize-docs, r=jhprattMatthias Krüger-0/+8
docs(std): add error docs for path canonicalize This PR adds the missing error documentation for both [Path.canonicalize](https://doc.rust-lang.org/std/path/struct.Path.html#method.canonicalize) and [PathBuf.canonicalize](https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.canonicalize) methods. Since both methods are wappers around [fs::canonicalize](https://doc.rust-lang.org/std/fs/fn.canonicalize.html), the error doc is copied directly from that function. This makes it faster to find what errors might arise when calling `path.canonicalize` or `path_buf.canonicalize` in the editor itself without needing to drill down to the `fs::canonicalzie` docs.
2025-09-08mark `format_args_nl!` as `#[doc(hidden)]`cyrgani-0/+1
2025-09-08const-eval: disable pointer fragment supportRalf Jung-5/+42
2025-09-08fix typos in commentFang He-2/+2
2025-09-08add some comments to clarify the fixFang He-0/+6
2025-09-08check before test for hardware capabilites in bits 32~63 of usizeFang He-33/+38
2025-09-08Auto merge of #146173 - Kmeakin:km/unicode-data/no-ascii, r=jhprattbors-247/+315
Don't include ASCII characters in Unicode tables Split off from https://github.com/rust-lang/rust/pull/145219
2025-09-07Fix typo in default.rsJustin Yao Du-1/+1