Skip to content

Rollup of 5 pull requests - #162278

Closed
JonathanBrouwer wants to merge 20 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-j2OZaEb
Closed

Rollup of 5 pull requests#162278
JonathanBrouwer wants to merge 20 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-j2OZaEb

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

MusicalNinjaDad and others added 20 commits September 2, 2026 06:56
Note: `cannot-infer-partial-try-return` not extended to cover both Uninhabited & !
- will only error on the first one
- not worth a second test to cover both
- in general replace Infallible with ! in try-adjacent situations (mainly Result<_, !>)
- where applicable extend tests to also validate both ! and a custom enum Uninhabited, to avoid unintentional future divergence
It's unused, and we should never have a single-element tuple in the AST.
They are trivial and the code is clearer with them gone.
It has only two call sites and the code is clearer with it gone.
This is a very common pattern in the AST visitor code:
```
visit_visitable!($($mut)? visitor, a, b, c);
```
It looks like the `$($mut)?` selects between the immutable visitor's
`visit_visitable!` (which doesn't accept `mut` at the start) and the
mutable visitor's (which does accept `mut` at the start).

That would make sense if `visit_visitable!` was a single macro with
separate rules for the immutable and mutable cases. But that's not the
case. The two `visit_visitable!` definitions are in different modules
and at any call site only one of them is visible within the relevant
`common_visitor_and_walkers!` invocation.

So the `$($mut)?` can be removed from the many `visit_visitable!` calls,
and also the `visit_visitable_with!` and `define_named_walk!` calls.
This makes the code easier to read.
Similar to the previous commit.
`generate_list_visit_fns` currently creates two functions for each case:
the method `MutVisitable::visit_mut` and the free function `$name`, of
the form `visit_foo`. The former calls the latter.

But the latter is a single line of code and can be easily inlined into
the former and removed. This avoids the need to provide `$name`. The
commit also changes the argument order so each case's
`$visit_fn` comes before the type, because that feels more natural.

It's a similar story for `generate_flat_map_visit_fns`.

Also, only support a single optional argument in these macros,
(a) because that's all that is needed and (b) to match all the other
macros.
Must be done manually because rustfmt doesn't do much within macro
definitions.

Also, the code currently has a mix of `&$($mut)? $($lt)?` and
`&$($lt)? $($mut)?` pairs. The inconsistency doesn't matter because only
one of `$mut` and `$lt` is ever present. But this commit changes them
all to the latter form for consistency.
The sanitize ignorelist gives central controls over which functions,
files, etc. should be ignored and not sanitized. It is a common file
format for clang and explained here:
https://clang.llvm.org/docs/SanitizerSpecialCaseList.html. This change
adds support for this list in Rust as well.
…alle

sanitizers: Implement support for the sanitize ignorelist

The sanitize ignorelist gives central controls over which functions, files, etc. should be ignored and not sanitized. It is a common file format for clang and explained here:
https://clang.llvm.org/docs/SanitizerSpecialCaseList.html. This change adds support for this list in Rust as well.

r? @rcvalle
c-variadic: use `emit_ptr_va_arg` for `va_arg` on `sparc`

I've built GCC for the target and validated pretty extensively that this works. Using our helper does generate worse code for `i64` unfortunately, I've reported that as llvm/llvm-project#214594. But, given that this is a tier-3 target etc. I don't think it makes sense to go out of our way to do better, we can just wait for LLVM to resolve that issue.
…ray, r=mu001999

Generalize Decodable impl for arrays to all types

This is almost the only impl that is not symetric with its Encodable counterpart. I tried to find out why in the history but it looks like this impl predates most of the generic symetric ones that are in this file, so it looks like it's not intentional.

I bumped into this randomly by changing a Vec to an array in some Mir types. The error was pretty confusing and It took me a while to figure out so I think it's worth generalizing this for somebody else in the future,  even though it's technically not necessary at the moment.

~~We piggyback off of `SmallVec` impl to avoid adding a `Default` bound or `MaybeUninit` unsafe dance. This moves the assert from the begining to the end of the loop.~~ We use `array::from_fn`
…ethercote

Update internal docs & tests to use `!` rather than `Infallible` in relation to `Try`

- Update docs, internal comments and tests to use `!` rather than `Infallible` in `Try` situations.
- Add a custom `enum Uninhabited {}` to specific clippy tests where unintentional future divergence in handling `!` vs other uninhabited types may be a possible concern

Refs:
- Never is ~~meow~~ now rust-lang#155499
- Try: rust-lang#84277 & rust-lang/goals#654
…r=fee1-dead

Clean up the AST visitor

The AST visitor is macro-heavy and complicated. This PR simplifies some aspects of it. Details in individual commits.

r? @fee1-dead
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Sep 4, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 4, 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 Sep 4, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 888478a 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 Sep 4, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 4, 2026
Rollup of 5 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 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 Sep 4, 2026
@rust-bors

rust-bors Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

@rust-bors

rust-bors Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: a8d7196 (a8d71969afb0ef0824cc46b6b8fcf7c8a045660e)
Base parent: 71238e2 (71238e21fc55e73ab3aad8c9f79fed7a47a179e1)

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs 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-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants