Commit graph

8834 commits

Author SHA1 Message Date
Jonathan Brouwer
65d982abd8
Rollup merge of #152469 - mu001999-contrib:cleanup/unused-features, r=nadrieril,jdonszelmann
Remove unused features

Detected by https://github.com/rust-lang/rust/pull/152164.

~~Only allow `unused_features` if there are complex platform-specific features enabled.~~
2026-02-13 13:34:58 +01:00
Stuart Cook
eaa6766793
Rollup merge of #152232 - chenyukang:add-must-use-for-filetimes, r=Mark-Simulacrum
Add must_use for FileTimes

Fixes rust-lang/rust#152231
2026-02-13 15:19:11 +11:00
mu001999
73c42c1800 Remove or allow unused features in library doc and tests 2026-02-13 09:27:16 +08:00
Lukas Bergdoll
2f3b952349 Stabilize assert_matches 2026-02-11 14:13:44 +01:00
yukang
d72eac8465 add must_use for FileTimes 2026-02-11 09:30:50 +08:00
Matthias Krüger
c15f4e0e47
Rollup merge of #142957 - xizheyin:142931, r=tgross35
std: introduce path normalize methods at top of `std::path`

Closes rust-lang/rust#142931

Mention other methods that call `conponents` and `canonicalize` that fully normalize path. And fix two typo.

r? libs
2026-02-09 18:39:41 +01:00
xizheyin
88c296a19f std: introduce path normalize methods at top of std::path 2026-02-09 18:25:26 +08:00
Jacob Pratt
e046884f49
Rollup merge of #152357 - nicholasbishop:push-uolpvnvrlznw, r=joboet
std: Don't panic when removing a nonexistent UEFI var

`std::env::remove_var` does not say that deleting a nonexistent variable is an error (and at least on Linux, it indeed does not cause an error).

The UEFI Shell Protocol spec also doesn't say it's an error, but the edk2 implementation delegates to the UEFI runtime `SetVariable` function, which returns `EFI_NOT_FOUND` when trying to delete a nonexistent variable.

Change the UEFI implementation to check for a `NotFound` error and treat it as success.

CC @Ayush1325
2026-02-09 05:20:27 -05:00
Stuart Cook
11c7917874
Rollup merge of #152071 - hanna-kruppe:stdio-fd-consts, r=ChrisDenton
Implement stdio FD constants

Tracking issue: rust-lang/rust#150836
2026-02-09 14:32:00 +11:00
Nicholas Bishop
4d07a8f24c std: Don't panic when removing a nonexistent UEFI var
`std::env::remove_var` does not say that deleting a nonexistent variable
is an error (and at least on Linux, it indeed does not cause an
error).

The UEFI Shell Protocol spec also doesn't say it's an error, but the
edk2 implementation delegates to the UEFI runtime `SetVariable`
function, which returns `EFI_NOT_FOUND` when trying to delete a
nonexistent variable.

Change the UEFI implementation to check for a `NotFound` error and treat
it as success.
2026-02-08 12:38:28 -05:00
Jonathan Brouwer
5964330d29
Rollup merge of #152056 - hzeller:feature-20260203-clarify-rwlock-reentrance, r=joboet
RwLock: refine documentation to emphasize non-reentrancy guarantees

This addresses the need for clarification brought up in rust-lang/rust#149693. Specifically, it notes that some implementations may choose to panic if they detect deadlock situations during recursive locking attempts for both `read()` and `write()` calls.

  * Provide an example highlighting that multiple read locks can be held across different threads simultaneously.
  * Remove the example that shows a situation that can potentially deadlock. (as demonstrated in the very same documentation a few paragraphs above)
  * Improve documentation regarding the possibility of panics during recursive read or write lock attempts.

Issues: https://github.com/rust-lang/rust/issues/149693
2026-02-07 19:34:49 +01:00
Jonathan Brouwer
6fe0999ad6
Rollup merge of #148590 - GrigorenkoPV:atomic_try_update, r=jhpratt
Stabilize `atomic_try_update`and deprecate `fetch_update` starting 1.99.0

Tracking issue: rust-lang/rust#135894
FCP completed: https://github.com/rust-lang/rust/issues/135894#issuecomment-3685449783

~1.96.0 was chosen because I don't think the remaining month until 1.93.0 becomes beta is enough for the FCP to finish and this to get merged, so 1.94.0 + a couple of versions of leeway: https://github.com/rust-lang/rust/issues/135894#issuecomment-3491707614~

1.99 suggested in https://github.com/rust-lang/rust/pull/148590#discussion_r2730000452

Closes rust-lang/rust#135894
2026-02-07 13:06:33 +01:00
bors
55bfca7d7d Auto merge of #152183 - alexcrichton:update-wasi-sdk, r=jieyouxu
Update wasi-sdk used in CI/releases

This is similar to prior updates such as rust-lang/rust#149037 in that this is just updating a URL. This update though has some technical updates accompanying it as well, however:

* The `wasm32-wasip2` target no longer uses APIs from WASIp1 on this target, even for startup. This means that the final binary no longer has an "adapter" which can help making instantiation of a component a bit more lean.

* In rust-lang/rust#147572 libstd was updated to use wasi-libc more often on the `wasm32-wasip2` target. This uncovered a number of bugs in wasi-libc such as rust-lang/rust#149864, rust-lang/rust#150291, and rust-lang/rust#151016. These are all fixed in wasi-sdk-30 so the workarounds in the standard library are all removed.

Overall this is not expected to have any sort of major impact on users of WASI targets. Instead it's expected to be a normal routine update to keep the wheels greased and oiled.
2026-02-06 12:21:48 +00:00
Alex Crichton
8e26944f62 Update wasi-sdk used in CI/releases
This is similar to prior updates such as 149037 in that this is just
updating a URL. This update though has some technical updates
accompanying it as well, however:

* The `wasm32-wasip2` target no longer uses APIs from WASIp1 on this
  target, even for startup. This means that the final binary no longer
  has an "adapter" which can help making instantiation of a component a
  bit more lean.

* In 147572 libstd was updated to use wasi-libc more often on the
  `wasm32-wasip2` target. This uncovered a number of bugs in
  wasi-libc such as 149864, 150291, and 151016. These are all fixed in
  wasi-sdk-30 so the workarounds in the standard library are all
  removed.

Overall this is not expected to have any sort of major impact on users
of WASI targets. Instead it's expected to be a normal routine update to
keep the wheels greased and oiled.
2026-02-05 15:04:55 -08:00
Jonathan Brouwer
cb77fcb3a6
Rollup merge of #152133 - Enselic:on-broken-pipe-flag-rename, r=ChrisDenton
library/std: Rename `ON_BROKEN_PIPE_FLAG_USED` to `ON_BROKEN_PIPE_USED`

This commit is a pure internal rename and does not change any functionality.

The `FLAG_` part of `ON_BROKEN_PIPE_FLAG_USED` comes from that the compiler flag `-Zon-broken-pipe=...` is used to enable the feature.

Remove the `FLAG_` part so the name works both for the current compiler flag `-Zon-broken-pipe=...` and for the upcoming [Externally Implementable Item `#[std::io::on_broken_pipe]`](https://github.com/rust-lang/rust/pull/150591) PR. This makes the diff of that PR smaller.

The local variable name `sigpipe_attr_specified` comes from way back when the feature was controlled with an `fn main()` attribute called `#[unix_sigpipe = "..."]`. Rename that too.
2026-02-05 12:17:03 +01:00
Zalathar
6970849fee Disable flaky test oneshot::recv_timeout_before_send 2026-02-05 12:38:23 +11:00
Martin Nordholts
01c0c147c5 library/std: Rename ON_BROKEN_PIPE_FLAG_USED to ON_BROKEN_PIPE_USED
This commmit is a pure rename and does not change any functionality.

The `FLAG_` part of `ON_BROKEN_PIPE_FLAG_USED` comes from that the
compiler flag `-Zon-broken-pipe=...` is used to enable the feature.

Remove the `FLAG_` part so the name works both for the flag
`-Zon-broken-pipe=...` and for the upcoming Externally Implementable
Item `#[std::io::on_broken_pipe]`. This makes the diff of that PR
smaller.

The local variable name `sigpipe_attr_specified` comes from way back
when the feature was controlled with an `fn main()` attribute called
`#[unix_sigpipe = "..."]`. Rename that too.
2026-02-04 19:47:51 +01:00
Jonathan Brouwer
3184d55536
Rollup merge of #152083 - chenyukang:yukang-fix-set-times-nofollow-on-windows, r=ChrisDenton
Fix set_times_nofollow for directory on windows

Fix issue from:
https://github.com/rust-lang/rust/issues/147455#issuecomment-3841311858

old code `opts.write(true)` on Windows requests `GENERIC_WRITE` access, replace with `opts.access_mode(c::FILE_WRITE_ATTRIBUTES)` to get minimal permission.

r? @joshtriplett
2026-02-04 14:39:28 +01:00
yukang
8e62b1d0e1 Fix set_times_nofollow for directory on windows 2026-02-04 03:58:26 +00:00
Hanna Kruppe
8b5be2b271 Implement stdio FD constants 2026-02-03 22:35:09 +01:00
Henner Zeller
27f97d7f71 RwLock: refine documentation to emphasize non-reentrancy guarantees
This addresses the need for clarification brought up in an issue.
Specifically, it notes that some implementations may choose to panic if
they detect deadlock situations during recursive locking attempts for
both `read()` and `write()` calls.

  * Provide an example highlighting that multiple read locks can be
    held across different threads simultaneously.
  * Remove the example that shows a situation that can potentially deadlock.
    (as demonstrated in the very same documentation a few paragraphs
    above)
  * Improve documentation regarding the possibility of panics during
    recursive read or write lock attempts.

Issues: Ambiguity in RwLock documentation about multiple read() calls...

Signed-off-by: Henner Zeller <h.zeller@acm.org>
2026-02-03 07:48:05 -08:00
Ralf Jung
079913ec71 disable socket tests in Miri 2026-02-03 09:02:39 +01:00
Jonathan Brouwer
22b2913464
Rollup merge of #151979 - nicholasbishop:push-ssmqyutnpypo, r=jhpratt
Fix uninitialized UEFI globals in tests

Export globals via a `doc(hidden)` module. In test code, use the globals from `realstd` so that they are properly initialized.

CC @Ayush1325
2026-02-02 18:52:16 +01:00
Nicholas Bishop
59868c1394 Fix uninitialized UEFI globals in tests
Export globals via a `doc(hidden)` module. In test code, use the globals
from `realstd` so that they are properly initialized.
2026-02-01 23:48:27 -05:00
bors
a60d12cbcc Auto merge of #151971 - Zalathar:rollup-KwKpKLY, r=Zalathar
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#151756 (Avoid miri error in `slice::sort` under Stacked Borrows)
 - rust-lang/rust#147400 (TryFrom<integer> for bool)
 - rust-lang/rust#150993 (std: sys: uefi: os: Implement join_paths)
 - rust-lang/rust#151483 (Add regression test for issue rust-lang/rust#138225)
 - rust-lang/rust#151568 (Update hexagon target linker configurations)
 - rust-lang/rust#151725 (Fix outdated Debian Ports ISO reference)
 - rust-lang/rust#151895 (Move UI tests batch)
 - rust-lang/rust#151923 (Fix ICE when projection error reporting sees opaque alias terms)
 - rust-lang/rust#151947 (Include assoc const projections in CFI trait object)
 - rust-lang/rust#151948 (Handle unbalanced delimiters gracefully in make_attr_token_stream)
 - rust-lang/rust#151963 (Add regression test for negative literal in a range of unsigned type)
2026-02-02 04:41:32 +00:00
Stuart Cook
512afea218
Rollup merge of #150993 - Ayush1325:uefi-join-path, r=Mark-Simulacrum
std: sys: uefi: os: Implement join_paths

- Tested using OVMF using QEMU.

@rustbot label +O-UEFI
2026-02-02 10:28:31 +11:00
kouhe3
1689fcd1cc feat(windows): add Unix domain socket support
This commit introduces initial, unstable support for Unix domain sockets
(UDS) on Windows, behind the `windows_unix_domain_sockets` feature gate

Added types:
- `std::os::windows::net::SocketAddr`: represents a UDS address with support
  for pathname addresses (abstract and unnamed are parsed but not yet fully
  supported).
- `std::os::windows::net::UnixListener`: server-side UDS listener.
- `std::os::windows::net::UnixStream`: client/server stream for UDS.

Key features:
- Binding and connecting using filesystem paths.
- Basic I/O via `Read`/`Write`.
- Address querying (`local_addr`, `peer_addr`).
- Non-blocking mode, timeouts, and socket duplication.
- Includes basic test coverage for smoke, echo, path length, and bind reuse.
2026-01-31 18:36:49 +08:00
Jonathan Brouwer
faa0d67374
Rollup merge of #149482 - RalfJung:scope-tls-dtors, r=joboet
thread::scope: document how join interacts with TLS destructors

Fixes https://github.com/rust-lang/rust/issues/116237 by documenting the current behavior regarding thread-local destructors as intended. (I'm not stoked about this, but documenting it is better than leaving it unclear.)

This also adds documentation for explicit `join` calls (both for scoped and regular threads), saying that those *will* wait for TLS destructors. That reflects my understanding of the current implementation, which calls `join` on the native thread handle. Are we okay with guaranteeing that? I think we should, so people have at least some chance of implementing "wait for all destructors" manually. This fixes https://github.com/rust-lang/rust/issues/127571.

Cc @rust-lang/libs-api
2026-01-29 17:47:31 +01:00
Zen
f5b53682a1
Fix grammar 2026-01-28 23:00:39 -05:00
Jonathan Brouwer
b841ab20de
Rollup merge of #151706 - PiJoules:fuchsia-nanosleep, r=joboet
Remove Fuchsia from target OS list in unix.rs for sleep

Fuchsia doesn't support clock_nanosleep so default back to using nanosleep
2026-01-28 21:10:52 +01:00
Jonathan Brouwer
1eba55e25d
Rollup merge of #151660 - fmease:bump-backtrace-demangler-alt, r=tgross35
Bump `std`'s `backtrace`'s `rustc-demangle`

Alternative to https://github.com/rust-lang/rust/pull/151659.

Fixes rust-lang/rust#151548.
2026-01-28 21:10:51 +01:00
Jonathan Brouwer
3f23c0997a
Rollup merge of #150968 - tgross35:remove-no-f16-f128, r=Amanieu
compiler-builtins: Remove the no-f16-f128 feature

This option was used to gate `f16` and `f128` when support across backends and targets was inconsistent. We now have the rustc builtin cfg `target_has_reliable{f16,f128}` which has taken over this usecase. Remove no-f16-f128 since it is now unused and redundant.
2026-01-28 21:10:50 +01:00
Leonard Chan
5dbaac1357 Remove Fuchsia from target OS list in unix.rs for sleep 2026-01-27 14:08:15 -08:00
Pavel Grigorenko
3a48b9fe1a Stabilize atomic_try_update
and deprecate fetch_update starting 1.99.0
2026-01-27 21:15:27 +03:00
Ayush Singh
90f0f4b75f
std: sys: uefi: os: Implement join_paths
- PATHS_SEP is defined as global const since I will implement
  split_paths in the future.
- Tested using OVMF using QEMU.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2026-01-27 22:50:49 +05:30
Jonathan Brouwer
7d11720fd3
Rollup merge of #151711 - folkertdev:stdarch-sync-2026-01-26, r=folkertdev
stdarch subtree update

Subtree update of `stdarch` to 9ba0a3f392.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-01-27 17:00:54 +01:00
joboet
fe51f9debc
std: move time implementations to sys (Hermit)
Last on the list: Hermit. Since I anticipate that Hermit will share the UNIX
implementation in the future, I've left `Timespec` in the PAL to maintain a
similar structure. Also, I noticed that some public `Instant` methods were
redefined on the internal `Instant`. But the networking code can just use the
public `Instant`, so I've removed them.
2026-01-27 10:52:25 +01:00
joboet
eec058eacc
std: move time implementations to sys (WASI/TEEOS)
WASI and TEEOS share the UNIX implementation. Since `Timespec` lives in the
PAL, this means that the `#[path]` imports of `unix/time.rs` still remain for
these two, unfortunately. Maybe we'll solve that in the future by always
including the UNIX PAL for these remotely UNIXy platforms. But that's a story
for another time...
2026-01-27 10:52:25 +01:00
joboet
05bbfa2593
std: move time implementations to sys (UNIX)
Now for UNIX: `Timespec` is also used for things like futex or `Condvar`
timeouts, so it stays in the PAL along with some related definitions.
Everything else is `SystemTime`- and `Instant`-specific, and is thus moved to
`sys::time`.
2026-01-27 10:52:25 +01:00
joboet
6cb343bfb2
std: move time implementations to sys (Windows)
Windows has a similar problem as UEFI: some internals are also used for
implementing other things. Thus I've left everything except for the actual
`Instant` and `SystemTime` implementations inside the PAL.

I've also taken the liberty of improving the code clarity a bit: there were a
number of manual `SystemTime` conversions (including one that masked an `i64`
to 32-bits before casting to `u32`, yikes) that now just call `from_intervals`.
Also, defining a `PerformanceCounterInstant` just to convert it to a regular
`Instant` immediately doesn't really make sense to me. I've thus changed the
`perf_counter` module to contain only free functions that wrap system
functionality. The actual conversion now happens in `Instant::now`.
2026-01-27 10:28:06 +01:00
joboet
963f6029ce
std: move time implementations to sys (UEFI)
Next up: UEFI. Unfortunately the time conversion internals are also required by
the filesystem code, so I've left them in the PAL. The `Instant` internals
however are only used for the `Instant` implementation, so I've moved them to
`sys` (for now).
2026-01-27 10:27:59 +01:00
joboet
bd754c7119
std: move time implementations to sys (Solid)
On SOLID, the conversion functions are also used to implement helpers for
timeout conversion, so these stay in the PAL. The `Instant` (µITRON) and
`SystemTime` (SOLID-specific) implementations are merged into one. While it was
nice to have the µITRON parts in a separate module, there really isn't a need
for this currently, as there is no other µITRON target. Let's not worry about
this until such a target gets added...

Note that I've extracted the `get_tim` call from `Instant` into a wrapper
function in the PAL to avoid the need to make the inner `Instant` field public
for use in the PAL.
2026-01-27 10:27:43 +01:00
joboet
5978e19456
std: move time implementations to sys (VEX)
Now that the `unsupported` module exists, we can use it for VEX. VEX actually
supports `Instant` though, so the implementation-select needs to combine that
with the `unsupported` module.
2026-01-27 10:27:30 +01:00
joboet
29b16c0a55
std: move time implementations to sys (small platforms)
Let's start with the easy ones:
* Motor just reexports its platform library
* The SGX code is just a trivial move
* Trusty, WASM and ZKVM are unsupported, this is very trivial. And we can get
  rid of some `#[path = ...]`s, yay!
2026-01-27 10:26:54 +01:00
joboet
814d902c50
std: move time implementations to sys (preparation) 2026-01-27 10:26:45 +01:00
Stuart Cook
956ebbde20
Rollup merge of #151383 - cyrgani:no-internal-deprecation, r=scottmcm
remove `#[deprecated]` from unstable & internal `SipHasher13` and `24` types

These types are unstable and `doc(hidden)` (under the internal feature `hashmap_internals`). Deprecating them only adds noise (`#[allow(deprecated)]`) to all places where they are used, so this PR removes the deprecation attributes from them.

It also includes a few other small cleanups in separate commits, including one I overlooked in rust-lang/rust#151228.
2026-01-27 12:50:52 +11:00
Folkert de Vries
fdad66a382
enable target_feature_inline_always in core and std
this is required for compiling `stdarch`
2026-01-26 23:17:31 +01:00
Chris Denton
aaeb550f6f
Update windows bindings in std 2026-01-26 10:59:16 +00:00
León Orell Valerian Liehr
f4731a17f6
Bump std's backtrace's rustc-demangle 2026-01-26 00:09:53 +01:00
Matthias Krüger
38504731be
Rollup merge of #150842 - PaulDance:patches/fix-win7-sleep, r=Mark-Simulacrum
Fix(lib/win/thread): Ensure `Sleep`'s usage passes over the requested duration under Win7

Fixes rust-lang/rust#149935. See the added comment for more details.

This makes the concerned test now reproducibly pass, for us at least. Also, testing this separately revealed successful: see the issue.

@rustbot label C-bug I-flaky-test O-windows-7 T-libs A-time A-thread
2026-01-25 07:42:59 +01:00