Skip to content

Make rustc_hir_analysis not depend on rustc_lint.#154361

Draft
nnethercote wants to merge 1 commit intorust-lang:mainfrom
nnethercote:rustc_hir_analysis-rustc_lint
Draft

Make rustc_hir_analysis not depend on rustc_lint.#154361
nnethercote wants to merge 1 commit intorust-lang:mainfrom
nnethercote:rustc_hir_analysis-rustc_lint

Conversation

@nnethercote
Copy link
Contributor

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 changeds emit_delayed_lint to emit_delayed_lints, factoring out some code duplicated in rustdoc.

`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 changeds `emit_delayed_lint` to `emit_delayed_lints`,
factoring out some code duplicated in rustdoc.
@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
Contributor Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 25, 2026

⌛ Trying commit 1eac51a with merge f563964

To cancel the try build, run the command @bors try cancel.

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-perf Status: Waiting on a perf run to be completed. 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.

3 participants