Skip to content

Convert strict_provenance_lints to late lint passes#156862

Open
hanna-kruppe wants to merge 2 commits into
rust-lang:mainfrom
hanna-kruppe:strict-provenance-late-lint
Open

Convert strict_provenance_lints to late lint passes#156862
hanna-kruppe wants to merge 2 commits into
rust-lang:mainfrom
hanna-kruppe:strict-provenance-late-lint

Conversation

@hanna-kruppe
Copy link
Copy Markdown
Contributor

@hanna-kruppe hanna-kruppe commented May 23, 2026

Right now, these lints run during type checking of cast expressions, but they work fine as regular late lint passes, so this PR converts them to passes.

Besides the generic reasons to prefer regular lint passes over "hardwired" lints, the move solves one problem unique to cast type checking: emitting diagnostics directly in CastCheck::do_check causes problems for clippy reusing the cast type checking code.

Tracking issue: #130351

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 23, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 23, 2026

r? @oli-obk

rustbot has assigned @oli-obk.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 18 candidates

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 23, 2026
Copy link
Copy Markdown
Contributor Author

@hanna-kruppe hanna-kruppe May 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it makes sense to keep this test. From the information in #137588 it seems like:

  1. The lint running and emitting a diagnostic is somehow a load-bearing part of the reproduction, so this test likely won't work as regression test any more with the changes in this PR.
  2. Nobody ever pinned down the root cause of the ICE, figured out which change fixed it, or found a reproduction that doesn't trigger a bunch of other compiler errors along the way.

I don't know how to update the test so it still has a chance of being useful as a regression test. And it doesn't seem like there's anyone who understood #137588 well enough to help with this.

View changes since the review

@hanna-kruppe hanna-kruppe changed the title Convert strict_provenance_lints to late lints Convert strict_provenance_lints to late lint passes May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants