Skip to content

Make rustc_hir_analysis not depend on rustc_lint.#154361

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
nnethercote:rustc_hir_analysis-rustc_lint
Mar 27, 2026
Merged

Make rustc_hir_analysis not depend on rustc_lint.#154361
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
nnethercote:rustc_hir_analysis-rustc_lint

Conversation

@nnethercote
Copy link
Copy Markdown
Contributor

@nnethercote nnethercote commented Mar 25, 2026

rustc_hir_analysis depends on rustc_lint in just a single function: emit_delayed_lint, which is used by the
"emit_ast_lowering_delayed_lints" checking section within rustc_hir_analysis::check_crate.

This commit moves that function and section to out of rustc_hir_analysis::check_crate, into rustc_interface, eliminating the dependency. This seems reasonable because the delayed lint errors aren't really related to HIR analysis, they were in there just because HIR analysis is what follows AST lowering.

This means rustc_hir_analysis and rustc_lint can both start compiling as soon as rustc_trait_selection finishes. This also changes the error order in one test, which doesn't matter.

The commit also changes emit_delayed_lint to emit_delayed_lints, factoring out some code duplicated in rustdoc.

r? @davidtwco

@rustbot rustbot added 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 25, 2026
@nnethercote
Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Mar 25, 2026
…<try>

Make `rustc_hir_analysis` not depend on `rustc_lint`.
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 25, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Mar 25, 2026

☀️ Try build successful (CI)
Build commit: f563964 (f563964173ddaf1ed3e37d5d0de92ec538aa79c2, parent: 212ef7770dfad656782207fda799bdae28fc5b7b)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (f563964): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

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

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (secondary -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)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.9% [-6.5%, -2.0%] 3
All ❌✅ (primary) - - 0

Cycles

Results (secondary 2.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)
7.9% [7.9%, 7.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 484.064s -> 483.055s (-0.21%)
Artifact size: 396.84 MiB -> 394.95 MiB (-0.48%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 26, 2026
@nnethercote nnethercote force-pushed the rustc_hir_analysis-rustc_lint branch from 1eac51a to b7be8e4 Compare March 26, 2026 02:54
`rustc_hir_analysis` depends on `rustc_lint` in just a single function:
`emit_delayed_lint`, which is used by the
"emit_ast_lowering_delayed_lints" checking section within
`rustc_hir_analysis::check_crate`.

This commit moves that function and section to out of
`rustc_hir_analysis::check_crate`, into `rustc_interface`, eliminating
the dependency. This seems reasonable because the delayed lint errors
aren't really related to HIR analysis. They were in there just because
HIR analysis follows AST lowering.

This means `rustc_hir_analysis` and `rustc_lint` can both start
compiling as soon as `rustc_trait_selection` finishes. This also changes
the error order in one test, which doesn't matter.

The commit also changes `emit_delayed_lint` to `emit_delayed_lints`,
factoring out some code duplicated in rustdoc.
@nnethercote nnethercote force-pushed the rustc_hir_analysis-rustc_lint branch from b7be8e4 to a733192 Compare March 26, 2026 03:32
@nnethercote nnethercote marked this pull request as ready for review March 26, 2026 03:33
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 26, 2026

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 26, 2026
@davidtwco
Copy link
Copy Markdown
Member

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Mar 26, 2026

📌 Commit a733192 has been approved by davidtwco

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 Mar 26, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Mar 26, 2026
…davidtwco

Make `rustc_hir_analysis` not depend on `rustc_lint`.

`rustc_hir_analysis` depends on `rustc_lint` in just a single function: `emit_delayed_lint`, which is used by the
"emit_ast_lowering_delayed_lints" checking section within `rustc_hir_analysis::check_crate`.

This commit moves that function and section to out of `rustc_hir_analysis::check_crate`, into `rustc_interface`, eliminating the dependency. This seems reasonable because the delayed lint errors aren't really related to HIR analysis, they were in there just because HIR analysis is what follows AST lowering.

This means `rustc_hir_analysis` and `rustc_lint` can both start compiling as soon as `rustc_trait_selection` finishes. This also changes the error order in one test, which doesn't matter.

The commit also changes `emit_delayed_lint` to `emit_delayed_lints`, factoring out some code duplicated in rustdoc.

r? @davidtwco
@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 Mar 27, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Mar 27, 2026

💥 Test timed out after 21600s

@Zalathar
Copy link
Copy Markdown
Member

Almost certainly a runner being flaky, but let's do a try job to double-check.

@bors try jobs=arm-android

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Mar 27, 2026
…<try>

Make `rustc_hir_analysis` not depend on `rustc_lint`.


try-job: arm-android
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Mar 27, 2026

☀️ Try build successful (CI)
Build commit: 1345cca (1345ccaf63c2892c294c966bbb474e3b2160960d, parent: 23903d01c237d7c7d4fb62b82ca846bc45de4e0c)

@Zalathar
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 Mar 27, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 27, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Mar 27, 2026

☀️ Test successful - CI
Approved by: davidtwco
Duration: 3h 6m 25s
Pushing e3691a5 to main...

@rust-bors rust-bors Bot merged commit e3691a5 into rust-lang:main Mar 27, 2026
13 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing ac40f5e (parent) -> e3691a5 (this PR)

Test differences

Show 2 test diffs

2 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard e3691a5bd58e92999bcbffedf640ecd61e02c29e --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. pr-check-1: 33m 8s -> 25m 5s (-24.3%)
  2. dist-x86_64-apple: 2h 27m -> 1h 59m (-18.8%)
  3. x86_64-gnu-tools: 1h 4m -> 52m 55s (-17.7%)
  4. dist-armv7-linux: 1h 51m -> 1h 32m (-16.8%)
  5. tidy: 2m 28s -> 2m 47s (+13.2%)
  6. optional-x86_64-gnu-parallel-frontend: 2h 43m -> 2h 22m (-12.6%)
  7. i686-gnu-2: 1h 42m -> 1h 30m (-11.8%)
  8. x86_64-gnu-debug: 2h 5m -> 1h 51m (-11.6%)
  9. dist-s390x-linux: 1h 38m -> 1h 28m (-10.3%)
  10. pr-check-2: 43m 38s -> 39m 17s (-10.0%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (e3691a5): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -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.3% [0.3%, 0.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 0.8%, secondary -2.8%)

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

mean range count
Regressions ❌
(primary)
3.7% [3.7%, 3.7%] 1
Regressions ❌
(secondary)
4.7% [4.7%, 4.7%] 1
Improvements ✅
(primary)
-2.2% [-2.2%, -2.2%] 1
Improvements ✅
(secondary)
-6.5% [-6.6%, -6.5%] 2
All ❌✅ (primary) 0.8% [-2.2%, 3.7%] 2

Cycles

Results (primary 2.6%, secondary 2.8%)

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

mean range count
Regressions ❌
(primary)
2.6% [2.6%, 2.6%] 1
Regressions ❌
(secondary)
2.8% [2.1%, 3.4%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.6% [2.6%, 2.6%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 484.633s -> 483.294s (-0.28%)
Artifact size: 397.11 MiB -> 395.05 MiB (-0.52%)

@nnethercote nnethercote deleted the rustc_hir_analysis-rustc_lint branch March 27, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants