Skip to content

Rollup of 7 pull requests#156249

Closed
JonathanBrouwer wants to merge 23 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-P8ylpAs
Closed

Rollup of 7 pull requests#156249
JonathanBrouwer wants to merge 23 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-P8ylpAs

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Successful merges:

Failed merges:

r? @ghost

Create a similar rollup

nnethercote and others added 23 commits May 4, 2026 14:29
- Improve a comment.
- Remove unused `[decode]` annotations on some arenas.
- Improve `impl_arena_allocatable_decoder`:
  - Make the first rule more like the second rule.
  - Remove unnecessary brackets.
  - Remove unused support for attributes other than `decode`.
The table names usually match the name of the corresponding query.
The `trait_impl_trait_tys` table is an exception; this commit renames it
`collect_return_position_impl_trait_in_trait_tys` to match the query.
- Remove comment about blanket implementation of `FallibleTypeFolder` --
  it does not exist. (It probably used to.)
- Fix some incorrect name references.
- Fix minor grammatical errors.
- Fix stale comment on `visit_region` -- it was a no-op once, but no
  longer.

LLM disclosure: Claude Code identified these problems with comments when
I asked it to review `fold.rs` and `visit.rs`. I verified the
correctness of the problems and made the changes by hand.
After llvm/llvm-project#195486 , LLVM has explicit handling for null
pointers in simd operations instead of using special handling based on
zeroes.

This causes LLVM with asserts enabled to detect an improperly typed mask
passed to splat (if the output vector does not have i32 elements), and
can cause SIGSEGV in more complex cases with asserts disabled.
Another user-transparent change, unifying outer-type information and the
existing VisitorState flags.
In order to follow along with the efforts to properly distinguish
already-normalised and unnormalized types, we separate the internal
interfaces of this lint that rely on normalized types from those that
do not. We do that by adding the `Unnormalized` wrapper to some
interfaces.
- Introduce `HAS_REGIONS`/`has_regions`, which is true if any regions
  are present.
- Add `fold_clauses` to `Shifter` and `RegionFolder` for consistency.
- Simplify `has_type_flags`.
- Remove unnecessary local variables in `HasTypeFlagsVisitor` methods.
- Use `|=` operator in one place.
- Avoid `is_break` in one place for consistency with nearby code.

LLM disclosure: Claude Code suggested these changes when I asked it to
review `fold.rs` and `visit.rs`. I verified the correctness of the
suggestions and made the changes by hand.
…, r=petrochenkov

lint ImproperCTypes: refactor linting architecture (part 2)

This is the second PR in an effort to split rust-lang#134697 (refactor plus overhaul of the ImproperCTypes family of lints) into individually-mergeable parts.

Contains the changes of the first PR, and splits the core type checking function into several bits, each focused on a specific aspect of FFI-safety.
Some logic which was outside of said core function was also moved into the new functions.

Superset of: rust-lang#146271
…rate, r=jdonszelmann

Lint unused pub items in binary crates

~~This PR adds a new unstable flag -Ztreat-pub-as-pub-crate as [@Kobzol](https://github.com/Kobzol) suggested.~~
~~When compiling binary crates with this flag, the seed worklist will only contain the entry fn and won't contain other reachable items. Then we can do the dead code analysis for pub items just like they are pub(crate).~~

Related zulip thread [#general > pub/pub(crate) within a binary is a footgun](https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/pub.2Fpub.28crate.29.20within.20a.20binary.20is.20a.20footgun/with/558931034).

---

Updated:

Adds a new lint `unused_pub_items_in_binary` (crate-level, default allow for now) instead of the previous unstable flag to lint unused `pub` items for binary crates.

See more details of implementation in rust-lang#149509 (comment).

This lint is allowed by default, but I believe this has been better than the unstable flag. Making it warn-by-default will lead to a lot of noise for this PR (like bless many tests). So I'd like to make it warn-by-default in a separate PR in the future.
…trochenkov

Fewer global node_id_to_def_id lookups

Several of these are unnecessary if we track the `LocalDefId` together with the `NodeId`. We can't remove the `NodeId` entirely, as it is needed for lints, but it's a useful refactoring for splitting node_id_to_def_id into a per-owner table in the future

r? @petrochenkov
… r=mejrs

Deny warnings in the test for crates that are available on stable

We've got a couple of crates, like `rustc_type_ir` that have parts disabled on stable. I believe part of this is so, for example, rust-analyzer can use bits of the compiler. We previously allowed warnings here, and I ran into one. This denies warnings in the test that compiles these stable crates (I chose not to on the crate itself, so you don't *constantly* run into the warnings if you have turned that off in `config.toml`). This test doesn't run by default, but it does run in CI.
…affleLapkin

Fold/visit tweaks

Details in individual commits.

r? @WaffleLapkin
… r=Zalathar

Metadata macro/query cleanups

Details in individual commits.

r? @Zalathar
llvm: Use correct type for splat mask

After llvm/llvm-project#195486 , LLVM has explicit handling for null pointers in simd operations instead of using special handling based on zeroes.

This causes LLVM with asserts enabled to detect an improperly typed mask passed to splat (if the output vector does not have i32 elements), and can cause SIGSEGV in more complex cases with asserts disabled.

@rustbot label: +llvm-main

r? @durin42
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label May 6, 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 S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 6, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 6, 2026

📌 Commit e58fc52 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 May 6, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 6, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #146273 (lint ImproperCTypes: refactor linting architecture (part 2))
 - #149509 (Lint unused pub items in binary crates)
 - #156173 (Fewer global node_id_to_def_id lookups)
 - #155961 (Deny warnings in the test for crates that are available on stable)
 - #156130 (Fold/visit tweaks)
 - #156131 (Metadata macro/query cleanups)
 - #156202 (llvm: Use correct type for splat mask)

Failed merges:

 - #156236 (resolve: Remove `MacroData`)
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job aarch64-apple failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

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

rust-bors Bot commented May 6, 2026

💔 Test for 6eb3f5b failed: CI. Failed job:

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 6, 2026
@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 6, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 6, 2026

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 (`#[…]`, `#![…]`) 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 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-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.

9 participants