Skip to content

Rework lint pass running#158239

Open
nnethercote wants to merge 6 commits into
rust-lang:mainfrom
nnethercote:rework-lint-pass-running
Open

Rework lint pass running#158239
nnethercote wants to merge 6 commits into
rust-lang:mainfrom
nnethercote:rework-lint-pass-running

Conversation

@nnethercote

@nnethercote nnethercote commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

View all comments

Some cleanups relating to the running of lint passes.

r? @Urgau

It's a bad name: long, and contains a negative. `skippable_lints` is
better.
In particular, `late_lint_mod` doesn't filter consistently: it only
checks if `builtin_lints` needs running in the `passes.is_empty()` case,
and it doesn't check if the other passes need running at all.
It's called in two cases: pre-expansion lists, and early lints. The
appropriate builtin pass is specified at the call site but the
appropriate other passes are chosen within, which is inconsistent.

This commit changes it so everything is chosen within, based on the
boolean `pre_expansion_lint` parameter. `check_ast_node_inner` is split
into `run_passes` and `run_pass`; the extra function is needed because
the genericness of `builtin_lints` is pushed down one level below
`check_ast_node`.
@rustbot

rustbot commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

clippy is developed in its own repository. If possible, consider making this change to rust-lang/rust-clippy instead.

cc @rust-lang/clippy

@rustbot rustbot added 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 Jun 22, 2026
Comment thread compiler/rustc_lint/src/lib.rs Outdated
@Urgau

Urgau commented Jun 22, 2026

Copy link
Copy Markdown
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 22, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 22, 2026
@rust-bors

rust-bors Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 9309619 (9309619fbed6f684597cb21e4d42b3451eadf882)
Base parent: 942ac9c (942ac9ce4116d4ea784c9882659372b34978b1f8)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (9309619): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-0.9%, -0.1%] 23
Improvements ✅
(secondary)
-0.5% [-1.0%, -0.2%] 34
All ❌✅ (primary) -0.3% [-0.9%, -0.1%] 23

Max RSS (memory usage)

Results (secondary -3.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.8% [-4.3%, -3.4%] 2
All ❌✅ (primary) - - 0

Cycles

Results (primary -3.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.0% [-3.0%, -3.0%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.0% [-3.0%, -3.0%] 1

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 512.761s -> 504.991s (-1.52%)
Artifact size: 353.08 MiB -> 353.62 MiB (0.15%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 22, 2026
@nnethercote

Copy link
Copy Markdown
Contributor Author

I have added a new commit renaming pass_must_run as is_lint_pass_required.

@rust-log-analyzer

This comment has been minimized.

@nnethercote nnethercote force-pushed the rework-lint-pass-running branch from 09591e3 to 2724e23 Compare June 23, 2026 00:40

@Urgau Urgau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me.

View changes since this review

@Urgau

Urgau commented Jun 23, 2026

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 2724e23 has been approved by Urgau

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 Jun 23, 2026
@jhpratt

jhpratt commented Jun 23, 2026

Copy link
Copy Markdown
Member

@bors p=6

threading between rollups

@rust-bors

rust-bors Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

💔 Test for e70076a failed: CI. Failed job:

@jhpratt

jhpratt commented Jun 24, 2026

Copy link
Copy Markdown
Member

no apparent cause

@bors retry

@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 Jun 24, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 24, 2026
Rework lint pass running



Some cleanups relating to the running of lint passes.

r? @Urgau
@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 Jun 24, 2026
@rust-bors

rust-bors Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 6913ee1 failed: CI. Failed jobs:

@jhpratt

jhpratt commented Jun 24, 2026

Copy link
Copy Markdown
Member

@bors retry

@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 Jun 24, 2026
@jhpratt

jhpratt commented Jun 24, 2026

Copy link
Copy Markdown
Member

Giving this a shot while I figure out the rollup situation

@bors p=5

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 24, 2026
Rework lint pass running



Some cleanups relating to the running of lint passes.

r? @Urgau
@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 Jun 24, 2026
@rust-bors

rust-bors Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

💔 Test for e04e764 failed: CI. Failed job:

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
  RUST_CI_OVERRIDE_RELEASE_CHANNEL: stable
  TOOLSTATE_PUBLISH: 1
##[endgroup]
    Updating crates.io index
error: failed to get `idna_adapter` as a dependency of package `idna v1.0.3`
    ... which satisfies dependency `idna = "^1.0"` of package `cookie_store v0.21.1`
    ... which satisfies dependency `cookie_store = "^0.21.1"` of package `ureq v3.0.8`
    ... which satisfies dependency `ureq = "^3"` of package `citool v0.1.0 (/home/runner/work/rust/rust/src/ci/citool)`

Caused by:
  failed to load source for dependency `idna_adapter`

Caused by:
  unable to update registry `crates-io`

Caused by:
  download of id/na/idna_adapter failed

Caused by:
  curl failed

Caused by:

@jhpratt

jhpratt commented Jun 24, 2026

Copy link
Copy Markdown
Member

@bors p=0

@bors retry

@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 Jun 24, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor

@bors p=6
Scheduling this before the next rollup

@rust-bors

rust-bors Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

⌛ Testing commit 2724e23 with merge a9a3722...

Workflow: https://github.com/rust-lang/rust/actions/runs/28070770324

rust-bors Bot pushed a commit that referenced this pull request Jun 24, 2026
Rework lint pass running



Some cleanups relating to the running of lint passes.

r? @Urgau
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
  NO_DOWNLOAD_CI_LLVM: 1
  WIX: /d/a/rust/rust/wix
##[endgroup]
    Updating crates.io index
error: failed to get `synstructure` as a dependency of package `yoke-derive v0.7.5`
    ... which satisfies dependency `yoke-derive = "^0.7.5"` of package `yoke v0.7.5`
    ... which satisfies dependency `yoke = "^0.7.4"` of package `icu_collections v1.5.0`
    ... which satisfies dependency `icu_collections = "~1.5.0"` of package `icu_normalizer v1.5.0`
    ... which satisfies dependency `icu_normalizer = "^1.4.3"` of package `idna_adapter v1.2.0`
    ... which satisfies dependency `idna_adapter = "^1"` of package `idna v1.0.3`
    ... which satisfies dependency `idna = "^1.0"` of package `cookie_store v0.21.1`
    ... which satisfies dependency `cookie_store = "^0.21.1"` of package `ureq v3.0.8`
    ... which satisfies dependency `ureq = "^3"` of package `citool v0.1.0 (D:\a\rust\rust\src\ci\citool)`

Caused by:
  failed to load source for dependency `synstructure`

Caused by:
  unable to update registry `crates-io`

Caused by:
  download of sy/ns/synstructure failed

Caused by:
  curl failed

Caused by:

@jhpratt

jhpratt commented Jun 24, 2026

Copy link
Copy Markdown
Member

@bors p=0

@bors retry

There's a stable backport and a very large rollup that should go before this imo

@rust-bors

rust-bors Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

❗ You can only retry pull requests that are approved and have a previously failed auto build.

Hint: There is currently a pending auto build on this PR. To cancel it, run @bors cancel.

@jhpratt

jhpratt commented Jun 24, 2026

Copy link
Copy Markdown
Member

Ugh rust-log-analyzer fooled me again

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

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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