Skip to content

Rollup of 13 pull requests - #161322

Closed
JonathanBrouwer wants to merge 39 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-ltt1gvI
Closed

Rollup of 13 pull requests#161322
JonathanBrouwer wants to merge 39 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-ltt1gvI

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

Embers-of-the-Fire and others added 30 commits May 21, 2026 15:14
Signed-off-by: Embers-of-the-Fire <stellarishs@163.com>
Add focused Miri coverage for the if-let closure capture change, demonstrating UB at closure construction when partial pattern capture reborrows dangling references.

Assisted-by: OpenAI:gpt-5.5
Signed-off-by: Embers-of-the-Fire <stellarishs@163.com>
… orphan check

`emit_orphan_check_error` already special-cases non-local types that
appear in a foreign trait's own parameter position (as opposed to
Self): for Slice, Array, and Tuple, the label reads "this is
not defined in the current crate because this is a foreign trait"
instead of naming the type. The Adt arm and the primitive/catch-all
arm never checked this and always named the type instead, even in the
same non-Self position.

This produced a confusing diagnostic for impls like

    impl PartialEq for u32 {}

where Rhs defaults to Self (u32), so both the Self label and
the Rhs label read `u32` is not defined in the current crate,
with the second one visually landing under PartialEq since the
defaulted Rhs has no span of its own.

Extend the existing is_foreign check to the Adt and catch-all arms
so all four cases behave consistently.

Addresses rust-lang#160648
This was already possible via `./x fix -- --allow-dirty`, but forwarding the
argument from bootstrap is more user-friendly.
This commit is an initial implementation of the `FnPtr` trait as
described in the `fn_static` tracking issue, which consists of moving
the internally unstable `core::marker::FnPtr` to `core::ops::FnPtr`, as
well as changing the API. Because `NonNull` is used in the new `as_ptr`
signature, it was also turned into a proper lang item.
Rust only supports the windowed Xtensa calling convention on all
upstream targets (esp32 family). Mark windowed and exception as
ABI-required features so a mismatched -Ctarget-cpu cannot silently
change the ABI.

Discussion: rust-lang#160530 (comment)
Rust currently supports a single Xtensa ABI, so apply the same spec
checks as wasm: unspecified llvm_abiname, no floatabi, no rustc_abi,
and unspecified or other cfg_abi.
ref mut const unstable matching ref

vec, vecdeque: rename alloc to allocator

staticallocator on ref mut as well

wording will be the death of me

words order words random word words random good

eeeeeeeeeeeee

oh yeah these need the bound
…full-capture, r=Nadrieril

fix: fix the capture behavior of `if let` in closures

Closes rust-lang#153982.
**TL;DR** This patch adds the missing capture behavior change for `if let` statements introduced in RFC 2229.

This patch converts
```rust
self.walk_local(init, pat, None, || self.borrow_expr(init, BorrowKind::Immutable))?;
```
into
```rust
self.walk_local(init, pat, None, || Ok(()))?;
```
so that `if let` now behaves like `let`.
…=jackh726

Initial implementation of `FnPtr` trait

This commit is an initial implementation of the `FnPtr` trait as described in the `fn_static` tracking issue, which consists of moving the internally unstable `core::marker::FnPtr` to `core::ops::FnPtr`, as well as changing the API. Because `NonNull` is used in the new `as_ptr` signature, it was also turned into a proper lang item.

Part of `fn_static`: rust-lang#148768
…x, r=petrochenkov

Unify E0117 foreign-trait label for ADT/primitive types with existing Slice/Array/Tuple handling

### What this does

`emit_orphan_check_error` (in `compiler/rustc_hir_analysis/src/coherence/orphan.rs`) already has an `is_foreign` flag, true whenever a non-local type sits in one of the *trait's own* parameter positions rather than `Self`. The `Slice`, `Array`, and `Tuple` arms already use it to switch their label to a generic "this is not defined in the current crate because this is a foreign trait" message instead of naming the type. The `Adt` arm and the catch-all `_` arm (covering primitives) never checked `is_foreign` and always named the type, even in the same non-Self position.

This PR extends the same `is_foreign` branch to those two arms, so all four are consistent. No new types or subdiagnostics reuses the existing `OnlyCurrentTraitsForeign` struct already used a few lines above.

LLM use :
I used LLM to explore the project and find where code that tags labels

### Before / after

```rust
impl PartialEq for u32 {
    fn eq(&self, _other: &Self) -> bool { todo!() }
}
```
Before :
```Plaintext
   |      |             `u32` is not defined in the current crate
   |      `u32` is not defined in the current crate
```

After :
```Plaintext
   |      |       `u32` is not defined in the current crate
   |      this is not defined in the current crate because this is a foreign trait
```
Addresses rust-lang#160648

r? compiler
…ejrs

Adding diagnostic item markers for multiple fs functions and structs

A couple months ago there were a good number of TOCTOU/other filesystem lint issues created by @estebank in the clippy repo such as:

* [`Path::metdata` after `Path::exists`](rust-lang/rust-clippy#17158)
* [opening multiple files under a directory without using `open_at`](rust-lang/rust-clippy#17156)
* [File deletion followed by file creation](rust-lang/rust-clippy#17153)
* [File path comparison without canonicalizing](rust-lang/rust-clippy#17155)
* [File creation followed by setting permissions](rust-lang/rust-clippy#17154)

(There are more TOCTOU/filesystem bug lints that could be made aside from the list above, e.g. with symlinks).

I was particularly interested in working on the last issue on file creation followed by setting permissions. However, I don't think I could start working on it without diagnostic items on filesystem functions like `fs::set_permissions` or `fs::create_dir_all`. I decided to put diagnostic item attributes on all the filesystem functions and a couple of the structs because they may be useful in creating clippy lints against TOCTOU bugs or other relevant filesystem operation bugs.
remove rustc_error_messages dependency
Relax codgen test variable regex

I'm not entirely sure what change on the LLVM side caused this, but it's now producing `%. = select i1 %2, i64 %1, i64 undef`. [ci failure](https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/48104/list?sid=01a01563-0b1a-4a00-a555-a0f42f19caf3&tab=output)

@rustbot label llvm-main

r? @durin42
Doc: clarify how `Read::bytes` handling Interrupted errors

Fixes rust-lang#161288
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Aug 18, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Aug 18, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,x86_64-gnu-aux,x86_64-gnu-llvm-21-3,x86_64-msvc-1,aarch64-apple-1,aarch64-apple-2,x86_64-mingw-1,i686-msvc-1,i686-msvc-2

@rust-bors

rust-bors Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

📌 Commit cf6e759 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 18, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 18, 2026
Rollup of 13 pull requests


try-job: dist-various-1
try-job: test-various
try-job: x86_64-gnu-aux
try-job: x86_64-gnu-llvm-21-3
try-job: x86_64-msvc-1
try-job: aarch64-apple-1
try-job: aarch64-apple-2
try-job: x86_64-mingw-1
try-job: i686-msvc-1
try-job: i686-msvc-2
@rust-bors

rust-bors Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 4a5cc8a (4a5cc8ab6b65c7d844dc656df777856de1055484)
Base parent: e71c0f1 (e71c0f1e3395b10a8c331317be1a5c107bdf7b2e)

@jhpratt jhpratt closed this Aug 19, 2026
@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 19, 2026
@rust-bors

rust-bors Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows PG-exploit-mitigations Project group: Exploit mitigations rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.