Commit Graph

9831 Commits

Author SHA1 Message Date
Jonathan Brouwer
6d10830164 Rollup merge of #162837 - clarfonthey:c-str-display, r=Darksonn
Dedicated Display type for CStr::display

Tracking issue: rust-lang/rust#139984

Should resolve the FCP concern.
2026-09-22 22:50:29 +02:00
bors
6bb1652a02 Auto merge of #163165 - JonathanBrouwer:rollup-qpPoMbu, r=JonathanBrouwer
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#162628 (Move `Const` from `rustc_middle` to `rustc_type_ir`)
 - rust-lang/rust#159589 (Avoid leaking opaque hidden types via auto trait candidates)
 - rust-lang/rust#147790 (constify comparison traits on sliced types)
 - rust-lang/rust#162325 (powerpc64-ibm-aix: fix cfg(target_abi) value)
 - rust-lang/rust#162786 (regression test for GCE inherent projection ICE)
 - rust-lang/rust#163065 (windows Dir::rename: remove incorrect is_dir query)
 - rust-lang/rust#163138 (feat(time): add `Duration::{WEEK, DAY, HOUR, MINUTE}`)
 - rust-lang/rust#163162 (Remove unused `make3.sh` CI script)
2026-09-22 17:35:56 +00:00
Jonathan Brouwer
beaba5284a Rollup merge of #163065 - RalfJung:win-is-dir, r=ChrisDenton
windows Dir::rename: remove incorrect is_dir query

Hopefully fixes https://github.com/rust-lang/rust/issues/163022
r? @ChrisDenton

try-jobs: test-x86_64-msvc-1
2026-09-22 17:06:47 +02:00
Jonathan Brouwer
923f22ad6c Rollup merge of #163136 - mejrs:lint_maintenance, r=jhpratt
library: prune allowed lints
2026-09-22 13:23:36 +02:00
mejrs
16ede108f0 library: prune allowed lints 2026-09-22 00:42:42 +02:00
Jonathan Brouwer
2f931d4166 Rollup merge of #162600 - maxdexh:box-generalize, r=clarfonthey
Make the last non-breaking box impl generalizations

Follow-up to rust-lang/rust#161946

r? clarfonthey
2026-09-21 17:34:10 +02:00
Jonathan Brouwer
7708dcb64b Rollup merge of #163020 - RalfJung:dir-remove-dir-fallback, r=Mark-Simulacrum
Dir: fix fallback impl for remove_dir

This completely ignored the `self` parameter...

r? @Mark-Simulacrum
Cc @Qelxiros please check your other PRs to ensure we don't have this mistake more often
2026-09-21 10:16:15 +02:00
Jonathan Brouwer
042e9bc467 Rollup merge of #162984 - ChrisDenton:access-allowed, r=clarfonthey
Windows: don't error if `access_mode` is set on `OpenOptions`

In [RFC 1252] it was decided to artificially restrict the combination of `File` access modes and creation modes for the sake of cross-platform compatibility. This is tested in [`library/std/src/fs/tests.rs`]. As the RFC says, using platform specific function should allow overriding this.

On Windows, [`access_mode`] does indeed override `read`, `write` and `append`. However currently `OpenOptions` can still error if you don't use `read`, `write` or `append`. For example:

```rust
use std::os::windows::fs::OpenOptionsExt;
File::options()
    .create_new(true)
    .write(true) // useless except it prevents std from erroring
    .access_mode(0)
```

This PR makes it so you don't need the misleading `write(true)`.

I also cleaned up the error handling for the access mode a bit. It was unnecessarily split between two functions.

[RFC 1252]: https://rust-lang.github.io/rfcs/1252-open-options.html#combination-of-access-modes-and-creation-modes
[`library/std/src/fs/tests.rs`]: 420ed2a0c3/library/std/src/fs/tests.rs (L1517)
[`access_mode`]: https://doc.rust-lang.org/stable/std/os/windows/fs/trait.OpenOptionsExt.html#tymethod.access_mode
2026-09-21 10:16:12 +02:00
Chris Denton
39f76c99e2 Refactor access_mode case out of match 2026-09-20 15:18:32 +00:00
Chris Denton
ac5ff45274 Windows: don't error if access_mode is set 2026-09-20 15:15:19 +00:00
Chris Denton
21d6920351 Test windows access_mode override 2026-09-20 15:06:13 +00:00
Jonathan Brouwer
e4575e6f76 Rollup merge of #162726 - devnexen:socket_unix_fix, r=Mark-Simulacrum
std: fix unix socket address panic on a full sun_path

linux reports an address length one byte past sockaddr_un when the path fills sun_path without a NUL, which made address() slice out of bounds since e96993c68f. cap the length at the size of sockaddr_un.
2026-09-20 17:04:24 +02:00
Ralf Jung
8a2e879b5d windows Dir::rename: remove incorrect is_dir query 2026-09-20 12:56:06 +02:00
Roland Xu
55518efa02 Rollup merge of #163007 - RalfJung:dirfd-clone, r=ChrisDenton
add Dir::try_clone

There's no `try_clone` listed on https://github.com/rust-lang/rust/issues/120426 but I assume that's a standard operation for all kinds of file descriptors?

Cc @the8472 @ChrisDenton
2026-09-20 09:23:43 +08:00
Roland Xu
797bcafb6c Rollup merge of #162875 - json420:seek_read_exact, r=clarfonthey
Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt

Tracking issue: https://github.com/rust-lang/rust/issues/162868

This adds `.seek_read_exact()` to `std::os::windows::fs::FileExt`, an exact port of `read_exact_at()` for `std::os::unix::fs::FileExt`.

And it adds `.seek_write_all()` to `std::os::windows::fs::FileExt`, an exact port of `write_all_at()` for `std::os::unix::fs::FileExt`.

Finally, it adds six tests.

First there is a smoke test for `seek_read_exact()`, `seek_write_all()`, an exact port of the test for the  `.seek_read()`, `.seek_write()` methods. This is to make sure we are getting the same pass-through behavior through the lens of established tests.

Then there are five tests for the `windows::fs::FileExt` trait itself, covering all `seek_read_exact()`, `seek_write_all()` corner cases except  `io::ErrorKind::Interrupted` (advise welcome on that one). These tests use mock implementations of the traits `seek_read()` and `seek_write()` methods.

No LLMs were used in writing this PR.
2026-09-20 09:23:40 +08:00
Jason Gerard DeRose
837ce844f9 Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt
* First pass at windows::fs::FileExt.seek_read_exact()
* First pass at windows::fs::FileExt.seek_write_all()
* Fix function signature in seek_read_exact(), duh
* First pass at tests for .seek_read_exact(), seek_write_all()
* Whitespace fix
* Use hypothetical seek_read_exact_seek_write_all feature also for .seek_read_exact()
* Tracking issues 162868
* Oops, fix seek_write_all() doc example, was using write_all_at() still
* Add mocked test for windows FileExt trait
* Spelling fixes
* Expand test for windows FileExt trait to include almost all scenarios
* Split three tests out of file_test_windows_fileext_trait()
* Remove old versions of those 3 tests
* Split remaining file_test_windows_fileext_trait() into case 4, 5
* More test cleanup, always test expected_offset where possible
* Test read first for consistency
* Use same doctsring examples as seek_read(), seek_write()
* Missing period
* Oops: actually call _exact(), _all() methods in case 2, 3
* Add missing seek_read_exact_seek_write_all feature flags in doc examples
2026-09-20 00:29:37 +00:00
Ralf Jung
bc5fd06c34 Dir: fix fallback impl for remove_dir 2026-09-19 16:25:47 +02:00
Ralf Jung
1b3f10d6f9 add Dir::try_clone 2026-09-19 11:50:01 +02:00
Jonathan Brouwer
f9e4ef3558 Rollup merge of #161743 - joonas-001:codex/round-ties-even-docs, r=JohnTitor
Add performance notes for the floating-point round method

This update has revised the documentation for f32::round and f64::round, stating that round_ties_even typically offers better performance on most hardware platforms, and reminding readers that the rounding rules at the midpoint are different for the two methods. This update addresses the unfinished documentation task in issue rust-lang/rust#55107.
2026-09-19 08:45:39 +02:00
bors
ed30c2ce5e Auto merge of #162909 - maxdexh:claw-back-va-arg-safe, r=clarfonthey
Destabilize `VaArgSafe`

Destabilizes `VaArgSafe` before 1.99 hits stable, due to open concerns about whether references should implement the trait, which would be breaking to add later.

See discussion on [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Implementing.20.60VaArgSafe.60.20on.20references.20is.20a.20breaking.20change/with/624980353).

Tracking issue: rust-lang/rust#162911
2026-09-17 21:59:09 +00:00
Max Dexheimer
5e3ad0017d Claw back VaArgSafe 2026-09-17 21:00:06 +02:00
Jonathan Brouwer
b6afcb5698 Rollup merge of #162856 - nodamushi:stabilize-command-ext-show-window, r=jhpratt
Stabilize CommandExt::show_window

Stabilize `std::os::windows::process::CommandExt::show_window`.

The final comment period of rust-lang/rust#127544 was completed.
https://github.com/rust-lang/rust/issues/127544#issuecomment-4697341189

I have been using this function for 2 years. I want to use this function on stable Rust.
So, I open a pull request.

`windows_process_extensions_show_window` feature appears only in the location I modified.

```
> rg 'windows_process_extensions_show_window'
src/tools/rust-analyzer/crates/ide-db/src/generated/lints.rs
17165:        label: "windows_process_extensions_show_window",
17166:        description: r##"# `windows_process_extensions_show_window`

library/std/src/os/windows/process.rs
191:    #[stable(feature = "windows_process_extensions_show_window", since = "CURRENT_RUSTC_VERSION")]
```

LLM disclosure: I asked an ChatGPT for the steps and manually created a commit. I handled the searching for the code to modify (using `rg`) and the actual editing (using `nano`) myself.
2026-09-17 16:50:58 +02:00
Jonathan Brouwer
b47b950149 Rollup merge of #162805 - ChrisDenton:exit-code-must-use, r=jhpratt
Add `must_use` lint to `ExitCode`

An [`ExitCode`](https://doc.rust-lang.org/nightly/std/process/struct.ExitCode.html) is intended to be returned from `main` (or used in other ways of terminating a process). It's also a `Result` like type in that it has success and error values. It's *probably* a mistake if it's ignored but if not it makes sense to require users to explicitly acknowledge that ignoring it is intentional (e.g. with `let _ = ...`).
2026-09-17 16:50:53 +02:00
Jonathan Brouwer
ce606c6186 Rollup merge of #160544 - zachs18:stabilize-trim_prefix_suffix, r=clarfonthey
Stabilize `feature(trim_prefix_suffix)` (`{str, [T], Path}::trim_prefix` and `{str, [T]}::trim_suffix`)

Closes rust-lang/rust#142312 (tracking issue)

FCP completed [here](https://github.com/rust-lang/rust/issues/142312#issuecomment-4920020056). There was discussion during FCP about a possibly adding `strip_circumfix`, but that wasn't mentioned as blocking.

r? libs-api
2026-09-17 16:50:48 +02:00
Jonathan Brouwer
6134f46cd9 Rollup merge of #160108 - ChayimFriedman2:stabilize-main-thread-windows, r=clarfonthey
Stabilize `windows_process_extensions_main_thread_handle`

I propose we stabilize the library feature `windows_process_extensions_main_thread_handle` (tracking issue https://github.com/rust-lang/rust/issues/96723).

## Stabilization Report

### Implementation History

This feature was added in https://github.com/rust-lang/rust/pull/96725, and not changed since.

### API Summary

```rust
// std::os::windows::process

pub trait ChildExt: Sealed {
    fn main_thread_handle(&self) -> BorrowedHandle<'_>;
}
```

This method gives access to the handle to the main thread of a spawned child process on Windows. It is not possible to get after spawning using documented APIs, and it's useful for example for resuming a process that started as suspended (while it's possible to enumerate all threads and resume them all, that's slower and more complicated).

### Experience Report

My personal reason for this is wanting to use it for this case exactly (resuming a suspended process) in rust-analyzer, see https://github.com/rust-lang/rust-analyzer/pull/22763#issuecomment-4997862266. Other people seem to want this for the same reason as well (for example in the tracking issue). [Searching GitHub for `.main_thread_handle()` gives 269 results](https://github.com/search?q=%22.main_thread_handle%28%29%22+language%3Arust&type=code). Some are for resuming processes, but there are also others - for example, [injecting a DLL](a1e26958d8/crates/launcher/src/game.rs (L98)). I [even found a project](3684d2dc84/datasets/repositories/repo_020_hyperfine/code/src/timer/windows_timer.rs (L71)) that gates using this method behind a feature, and if it's not set, uses an undocumented Windows API instead.

### Unresolved Questions

There are two unresolved questions:

 - The naming - should it be the "main thread" or the "primary thread". Microsoft's documentation refers to it as the "primary thread", but our own docs mention "main thread" (https://doc.rust-lang.org/std/thread/index.html), as stated in https://github.com/rust-lang/rust/issues/96723#issuecomment-1869909355. I left it as "main thread".
 - Should it return `Option<BorrowedHandle<'_>>`? This will enable conversion from a handle to `std::process::Child` (such conversion is not supported currently). Such conversion is not supported for any OS currently though, and making this function returning `Option` will complicate code using it, so I chose to not do that.

r? libs-api
2026-09-17 16:50:47 +02:00
ltdk
71ef655c92 Dedicated Display type for CStr::display 2026-09-17 08:19:09 -04:00
Chris Denton
99261fb06c Add must_use lint to ExitCode 2026-09-16 22:02:27 +00:00
nodamushi
94cc692336 Stabilize CommandExt::show_window 2026-09-16 23:33:46 +09:00
Jonathan Brouwer
556c0e625b Rollup merge of #159562 - Joel-Wwalker:154071-stdio-handle-cache, r=aapoalas
Windows: cache the stdio write mode for the duration of a lock session

On Windows, every write to stdout/stderr calls `GetStdHandle` and `GetConsoleMode` (and `GetConsoleOutputCP` for consoles) to decide how to write. For bulk writes through a locked handle that is most of the work; rust-lang/rust#154071 measured 14% of CPU time in `is_console` alone.

This caches the handle and the console verdict in the sys-level `Stdout`/`Stderr` and re-queries when a new lock session begins, as [suggested in the issue](https://github.com/rust-lang/rust/issues/154071#issuecomment-4092410339). Holding a `StdoutLock` pins the stream; unlocked writes acquire the lock per call, so they re-query per write exactly as before, and `SetStdHandle` calls made between lock sessions keep working (the rust-lang/rust#40490 behavior is preserved).

Numbers from the issue's workload shape (16 KiB chunks to `NUL`, 4 GiB total, Windows 11):

| mode | before | after |
|---|---|---|
| `stdout().lock()` | 0.478 s (8,561 MiB/s) | 0.120 s (34,350 MiB/s) |
| unlocked | 0.467 s | 0.293 s |

The unlocked case also improves because one implicit lock session can contain several sys-level writes when `LineWriter` splits a chunk at newlines.

The console path cannot run in CI, so it was verified under a pseudoconsole: several writes through one lock session on a CP437 console came through `WriteConsoleW` intact (non-ASCII included), and after `SetConsoleOutputCP` plus a new lock session the refresh picked up the change.

The `refresh` hook is a small `#[cfg(windows)]` shim on `StdoutRaw`/`StderrRaw`; happy to change it to a method on every platform's sys type instead if that is preferred.

Fixes rust-lang/rust#154071
2026-09-15 23:26:58 +02:00
Jonathan Brouwer
73ee9888b2 Rollup merge of #162584 - bjorn3:incr_comp_prefer_flock, r=petrochenkov
Use File::*lock*() in rustc_data_structures::flock when possible

And only fallback to `fcntl(F_SETLK)` on Unix when `flock()` is not supported. `flock()` is a lot more sane than `fcntl(F_SETLK)` as it is fd scoped rather than process-scoped and reentrant. `fcntl(F_SETLK)` risks multiple instances of rustc inside the same process acquiring a lock on the same file even when an exclusive lock is requested. Using `File::*lock*()` also allows removing a fair amount of platform specific code for the file locking.

Fixes https://github.com/rust-lang/rust/issues/161361
2026-09-15 23:26:55 +02:00
Zachary S
9559b382e8 Stabilize trim_prefix_suffix 2026-09-15 15:23:26 -05:00
Joel-Wwalker
0154b97825 Windows: cache the stdio write mode for the duration of a lock session
* Windows: cache the stdio write mode for the duration of a lock session

Every write to stdout/stderr re-queried GetStdHandle and GetConsoleMode
(and GetConsoleOutputCP for consoles) to decide how to write, which
dominates bulk writes through a locked handle. Cache the handle and the
console verdict in the sys-level Stdout/Stderr and re-query when a new
lock session begins, so SetStdHandle calls made between lock sessions
keep working.
* Gate the stdio lock-session refresh to Windows

On targets where refresh is a no-op, lock() now compiles to exactly
the code it had before, instead of relying on the borrow-flag dance
optimizing out.
2026-09-15 13:50:41 -04:00
Jonathan Brouwer
83e19bc0c9 Rollup merge of #162643 - ChrisDenton:trailing-sep-verbatim, r=Mark-Simulacrum
Fix `path_trailing_sep` methods for Windows verbatim paths

Normally on Windows the path separator is either `\` or `/` but for verbatim paths it is only `\`. Currently the unstable `path_trailing_sep` methods (rust-lang/rust#142503) do not take that into account and just use the general `is_sep_byte` method.

This PR changes it to use the internal `Components::is_sep(self, b)` method that takes into account verbatim paths.
2026-09-15 09:32:37 +02:00
Mikhail Baykov
0f916bb579 std: Make a lot of pub items crate private instead (ignore os/sys)
Most of them don't need to be public, but there are scenarios where
thing is private on one platform but public on the other, so having a
lint on all the time gets complicated.

Added #![warn(unreachable_pub)] in library/std/src/lib.rs
Added #[allow(unreachable_pub)] on top of std::os and std::sys specifically.
2026-09-14 03:47:37 -04:00
Jacob Pratt
a69f8f9a09 Rollup merge of #161178 - amirHdev:unstable-reexport, r=mejrs
lint ineffective #[unstable] annotations on re-exports

Refs rust-lang/rust#161153

https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/stability.20attributes.20on.20imports.20.26.20cargo-semver-checks/with/616818373
2026-09-13 21:03:50 -04:00
Jacob Pratt
f19b1b0832 Rollup merge of #154113 - devnexen:socket_mod_ttl_fix, r=Mark-Simulacrum
std::net: clamp multicast ttl value to u8 max.

on some platforms the underlying type is c_uchar,
values above 255 would silently truncate.
2026-09-13 21:03:50 -04:00
David Carlier
4c3c97f5aa std: fix unix socket address panic on a full sun_path
linux reports an address length one byte past sockaddr_un when the path
fills sun_path without a NUL, which made address() slice out of bounds
since e96993c68f. cap the length at the size of sockaddr_un.
2026-09-13 15:15:33 +01:00
Amirhossein Akhlaghpour
d8059afd56 handle unstable modules in ineffective reexport lint
Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
2026-09-13 13:22:13 +03:30
bors
98fd715edd Auto merge of #162676 - Windolon:fix_expect, r=JohnTitor
Update doc expect messages in sync module following style guide



Updates user-facing docs in the `sync` module following the style guide.
2026-09-13 08:50:23 +00:00
Roland Xu
69fdca8af6 Rollup merge of #161520 - yoshuawuyts:stabilize-dropguard, r=nia-e
Stabilize `core::mem::DropGuard`

Closes https://github.com/rust-lang/rust/issues/144426. This PR stabilizes `core::mem::DropGuard`, as per the comment in https://github.com/rust-lang/rust/issues/144426#issuecomment-5332324003:

> [nia-e]: We discussed this in today's libs meeting - DropGuard is a good name, and we agreed dismiss is Good Enough & better than the other options. Feel free to send a stabilisation PR & ask us to open FCP there!

Thanks!

r? @nia-e
2026-09-13 09:39:00 +08:00
Windolon
eaecaeccf7 Update doc expect messages for files in library/std/src/sync/ following style guide 2026-09-12 15:54:06 +08:00
Chris Denton
4750ec7ba0 Fix *_trailing_sep for Windows verbatim paths 2026-09-11 14:35:59 +00:00
Jacob Pratt
6036ee7658 Rollup merge of #162492 - CAD97:rm-xdg, r=ChrisDenton
Revert "Rollup merge of #157518 - CAD97:xdg_basedir, r=aapoalas"

This reverts commit ac8006482d, reversing changes made to 8d6b38095e.

<!-- homu-ignore:start -->

- https://github.com/rust-lang/rust/issues/157515 is superseded
- This includes just the revert that's the first commit in https://github.com/rust-lang/rust/pull/158936
2026-09-11 00:03:06 -04:00
Jacob Pratt
4e1c7f9f55 Rollup merge of #162270 - ChrisDenton:winagain, r=clarfonthey
Update `windows-bindgen` to 0.100.0

This release represents a major change in the way bindings are generated. See https://github.com/microsoft/windows-rs/issues/4867 for details.

In short, it now more directly follows the C headers. For the standard library's purposes this is mostly reflected in relatively minor type changes or with some `const` pointers becoming `mut`.

There is however one big change that affects a lot of types. In the headers there are a lot of `#define`s like this:

```c
#define GENERIC_READ                     (0x80000000L)
#define GENERIC_WRITE                    (0x40000000L)
```

These are constants for the access mode. In this case they're explicitly declared as `L` (aka signed long) integer types (in other cases there's no type at all). However, this conflicts with how access mode constants are actually used. E.g., see `CreateFileW`:

```c
WINBASEAPI
HANDLE
WINAPI
CreateFileW(
    _In_ LPCWSTR lpFileName,
    _In_ DWORD dwDesiredAccess,
    _In_ DWORD dwShareMode,
    _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes,
    _In_ DWORD dwCreationDisposition,
    _In_ DWORD dwFlagsAndAttributes,
    _In_opt_ HANDLE hTemplateFile
    );
```

Here `dwDesiredAccess` is a `DWORD`, which in rust equates to `u32`. The constant being signed but the usage being unsigned is not a problem for C/C++. They will happily convert between types at the drop of a hat. Rust however is stricter, as you know.

The old metadata used by `windows-bindgen` tried to try to fixup this mismatch but the new one goes strictly by what can be inferred from the headers.  The hope in the future is that the headers themselves will be updated so better bindings can be directly derived from them.
2026-09-11 00:03:06 -04:00
Chris Denton
d45c710149 Remove unnecessary manual bindings
Mingw used to have an incorrect import library for the synchronization functions `WaitOnAddress`, `WakeByAddressSingle` and `WakeByAddressAll`. This was fixed a long time ago and our windows-gnu targets require a much newer mingw in any case.
2026-09-10 21:24:00 +00:00
Chris Denton
fc4de336c5 Use new windows bindings 2026-09-10 21:23:52 +00:00
Jonathan Brouwer
02056c6f40 Rollup merge of #162539 - alexcrichton:update-wit-bindgen-deps, r=ChrisDenton
Update wasip2/wasip3 libstd crate dependencies

Picks up the latest version of the `wit-bindgen` dependency which has improved compatibility for `wasm32-wasip3`.
2026-09-10 22:33:59 +02:00
Jonathan Brouwer
83e0995a64 Rollup merge of #161334 - jethrogb:fix-sgx-unsafe-list, r=nia-e
Fix soundness issues in std::sys::pal::sgx::waitqueue::unsafe_list

Replace invalid uses of references in `std::sys::pal::sgx::waitqueue::unsafe_list` internals with raw pointers. I tried to keep the code structure the same as much as possible. In addition to the use of references flagged in the original issue, it turns out the head/tail (raw) pointer stored in the linked list caused provenance issues in miri. Switched to using UnsafePinned for that.

PR organization:
* Commit 1: Main soundness fix.
* Commit 2: Use pinning in the `pub(crate)` API for UnsafeList. This code predates pinning in Rust. I believe this change isn't strictly necessary as I believe it's valid to document pinning requirements in the unsafe methods on UnsafeList. However, I felt it's better to be explicit about this now that pinning is available in the language.
* Commit 3: Move UnsafeList to a platform-agnostic location so miri can be run on the test suite. This also adds some tests.

This PR was developed with Claude Fable 5 through extensive interactive use, where I directed a detailed plan for making the changes needed for this fix. My input includes keeping the structure the same and the new internal abstraction for dealing with raw pointers. I'm not familiar with miri, I used Claude to test the changes with miri. It said the test suite was failing before the changes (both stacked borrows and tree borrows) but passing after. The additional tests developed this way have been added in the third commit. The head/tail pointer provenance issue was found with Claude. I thoroughly reviewed all the code, including comments, and made manual changes/deletions where necessary/appropriate. The PR description was written by me.

r? @nia-e

Fixes rust-lang/rust#114581
Fixes rust-lang/rust#160603
Fixes rust-lang/rust#161060
Supersedes rust-lang/rust#160641
2026-09-10 22:33:56 +02:00
Max Dexheimer
79a93e7b03 Make the last non-breaking box impl generalizations 2026-09-10 17:31:15 +02:00
bjorn3
e2bdf3593e Flock is supported on Redox OS 2026-09-10 12:33:10 +02:00