Rollup of 13 pull requests - #161322
Closed
JonathanBrouwer wants to merge 39 commits into
Closed
Conversation
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
Rename test so it matches the issue r? @petrochenkov
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
Member
Author
Contributor
This comment has been minimized.
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
Contributor
Contributor
|
This pull request was unapproved due to being closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
if letin closures #154210 (fix: fix the capture behavior ofif letin closures)FnPtrtrait #156176 (Initial implementation ofFnPtrtrait)./x fix --allow-dirty#161220 (bootstrap: Allow./x fix --allow-dirty)ProjectionPredicateandTraitPredicate#161291 (RenameProjectionPredicateandTraitPredicate)rustc_thread_pool#161296 (Enable overflow checks inrustc_thread_pool)Read::byteshandling Interrupted errors #161318 (Doc: clarify howRead::byteshandling Interrupted errors)r? @ghost
Create a similar rollup