about summary refs log tree commit diff
path: root/library
AgeCommit message (Collapse)AuthorLines
2025-09-25Revert "Auto merge of #144086 - clubby789:alloc-zeroed, r=nikic"Nikita Popov-1/+0
This reverts commit 040a98af70f0a7da03f3d5356531b28a2a7a77e4, reversing changes made to e8a792daf500b5ff8097896ddb6cc037abe92487.
2025-09-14Update CURRENT_RUSTC_VERSION post-bumpMark Rousskov-121/+121
2025-09-13Rollup merge of #146521 - folkertdev:document-va-arg-safe, r=workingjubileeJacob Pratt-6/+23
document `core::ffi::VaArgSafe` tracking issue: https://github.com/rust-lang/rust/issues/44930 A modification of https://github.com/rust-lang/rust/pull/146454, keeping just the documentation changes, but not unsealing the trait. Although conceptually we'd want to unseal the trait, there are many edge cases to supporting arbitrary types. We'd need to exhaustively test that all targets/calling conventions support all types that rust might generate (or generate proper error messages for unsupported cases). At present, many of the `va_arg` implementations assume that the argument is a scalar, and has an alignment of at most 8. That is totally sufficient for an MVP (accepting all of the "standard" C types), but clearly does not cover all rust types. This PR also adds some various other tests for edge cases of c-variadic: - the `#[inline]` attribute in its various forms. At present, LLVM is unable to inline c-variadic functions, but the attribute should still be accepted. `#[rustc_force_inline]` already rejects c-variadic functions. - naked functions should accept and work with a C variable argument list. In the future we'd like to allow more ABIs with naked functions (basically, any ABI for which we accept defining foreign c-variadic functions), but for now only `"C"` and `"C-unwind` are supported - guaranteed tail calls: c-variadic functions cannot be tail-called. That was already rejected, but there was not test for it. r? `@workingjubilee`
2025-09-13Rollup merge of #146517 - RalfJung:wait-timeout, r=joboetJacob Pratt-10/+8
fix Condvar::wait_timeout docs [Context](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Condvar.20wait_timeout.20sleep.20duration.20decremented/with/539279839) r? `@joboet`
2025-09-13Rollup merge of #146473 - RalfJung:system-time-deconst, r=workingjubileeJacob Pratt-183/+75
Revert "Constify SystemTime methods" This reverts https://github.com/rust-lang/rust/pull/144519. The const-hacks introduces bugs, and they make the code harder to maintain. Let's wait until we can constify these functions without changing their implementation. Fixes https://github.com/rust-lang/rust/issues/146228. Closes https://github.com/rust-lang/rust/issues/144517 (since the feature is gone). r? `@tgross35` Cc `@clarfonthey`
2025-09-13c-variadic: document `core::ffi::VaArgSafe`Folkert de Vries-6/+23
and document `VaList::arg`.
2025-09-13fix Condvar::wait_timeout docsRalf Jung-10/+8
2025-09-13fixup `become` kw documentation wrt `#[track_caller]`Waffle Lapkin-1/+4
2025-09-13Document `become` keywordMaybe Waffle-0/+99
2025-09-13also apply revert to wasip2Ralf Jung-18/+7
2025-09-13Rollup merge of #145471 - rs-sac:extr, r=the8472Jacob Pratt-14/+10
Stabilize BTree{Map,Set}::extract_if Tracking issue: rust-lang/rust#70530 FCP completed: https://github.com/rust-lang/rust/issues/70530#issuecomment-3191454465 Closes: rust-lang/rust#70530
2025-09-13Rollup merge of #146481 - ferrocene:pvdrz/improve-hash-coverage, r=jhprattJana Dönszelmann-0/+13
Improve `core::hash` coverage This PR improves the `core::hash` coverage by adding a new test to `coretests` and extending one of the existing tests to use 128-bit integers r? libs
2025-09-13Rollup merge of #146477 - ferrocene:pvdrz/improve-char-coverage, r=NoratriebJana Dönszelmann-0/+44
Improve `core::char` coverage This PR improves the `core::char` coverage by adding new tests to `coretests` r? ``@workingjubilee``
2025-09-13Rollup merge of #146452 - ferrocene:pvdrz/improve-alloc-coverage, r=tgross35Jana Dönszelmann-0/+24
Improve `alloc::Layout` coverage This PR improves the `core::alloc` coverage by adding a new test to `coretests` that cover the `Layout` methods when they error. Tracking issue: https://github.com/rust-lang/rust/issues/55724
2025-09-12Improve `core::hash` coverageChristian Poveda-0/+13
2025-09-12Auto merge of #144847 - Randl:const-ord, r=oli-obkbors-107/+219
Constify Eq, Ord, PartialOrd Adds `#[const_trait]` and impls for `Eq`, `Ord`, `PartialOrd`. Impl for some other traits (e.g., slices and arrays) are blocked mainly on const closures (https://github.com/rust-lang/rust/issues/106003). For TypeId Ord we need const pointer comparison (https://github.com/rust-lang/rust/issues/53020) Tracking issue https://github.com/rust-lang/rust/issues/143800
2025-09-12Improve `core::char` coverageChristian Poveda-0/+44
2025-09-12Improve `core::alloc` coverageChristian Poveda-0/+24
2025-09-12Revert "Constify SystemTime methods"Ralf Jung-165/+68
This reverts commit 7ce620dd7c6fc3371290b40a1ea28146f0d37031. The const-hacks introduces bugs, and they make the code harder to maintain. Let's wait until we can constify these functions without changing their implementation.
2025-09-12Auto merge of #146468 - Zalathar:rollup-6u3s44d, r=Zalatharbors-66/+124
Rollup of 15 pull requests Successful merges: - rust-lang/rust#144549 (match clang's `va_arg` assembly on arm targets) - rust-lang/rust#145895 (thread parking: fix docs and examples) - rust-lang/rust#146308 (support integer literals in `${concat()}`) - rust-lang/rust#146323 (check before test for hardware capabilites in bits 32~63 of usize) - rust-lang/rust#146332 (tidy: make behavior of extra-checks more uniform) - rust-lang/rust#146374 (Update `browser-ui-test` version to `0.22.2`) - rust-lang/rust#146413 (Improve suggestion in case a bare URL is surrounded by brackets) - rust-lang/rust#146426 (Bump miow to 0.60.1) - rust-lang/rust#146432 (Implement `Socket::take_error` for Hermit) - rust-lang/rust#146433 (rwlock tests: fix miri macos test regression) - rust-lang/rust#146435 (Change the default value of `gcc.download-ci-gcc` to `true`) - rust-lang/rust#146439 (fix cfg for poison test macro) - rust-lang/rust#146448 ([rustdoc] Correctly handle literal search on paths) - rust-lang/rust#146449 (Fix `libgccjit` symlink when we build GCC locally) - rust-lang/rust#146455 (test: remove an outdated normalization for rustc versions) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-12Rollup merge of #146439 - connortsui20:fix-sync-macro-attr, r=RalfJungStuart Cook-12/+15
fix cfg for poison test macro Fixes test regression in https://github.com/rust-lang/rust/pull/144648 Continuation of https://github.com/rust-lang/rust/pull/146433 I think this is right? Not really sure how to test this myself to be honest. r? ```@RalfJung``` I'll also leave the improvement to the test macro for a separate PR (described [here](https://github.com/rust-lang/rust/pull/146433#issuecomment-3280210451)) since I've never done something like that before. Though since this fixes all of the tests, it might not be necessary since anyone in the future will see the `cfg()` and not `cfg_attr()`?
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-12Constify Eq, Ord, PartialOrdEvgenii Zheltonozhskii-107/+219
2025-09-12Auto merge of #146019 - joboet:better-dlsym, r=tgross35bors-51/+112
std: optimize `dlsym!` macro and add a test for it The `dlsym!` macro always ensures that the name string is nul-terminated, so there is no need to perform the check at runtime. Also, acquire loads are generally faster than a load and a barrier, so use them. This is only false in the case where the symbol is missing, but that shouldn't matter too much.
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-11update doc commentConnor Tsui-1/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2025-09-11fix config for poison macro testConnor Tsui-15/+18
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
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: only test `dlsym!` on platforms where it is actually usedjoboet-0/+10
`dlsym` doesn't work for finding libc symbols on platforms like linux-musl, so the test will fail.
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