Make rustc_hir_analysis not depend on rustc_lint.#154361
Draft
nnethercote wants to merge 1 commit intorust-lang:mainfrom
Draft
Make rustc_hir_analysis not depend on rustc_lint.#154361nnethercote wants to merge 1 commit intorust-lang:mainfrom
rustc_hir_analysis not depend on rustc_lint.#154361nnethercote wants to merge 1 commit intorust-lang:mainfrom
Conversation
`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.
Contributor
Author
|
@bors try @rust-timer queue |
Collaborator
|
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
Contributor
|
⌛ Trying commit 1eac51a with merge f563964… To cancel the try build, run the command 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`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rustc_hir_analysisdepends onrustc_lintin 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, intorustc_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_analysisandrustc_lintcan both start compiling as soon asrustc_trait_selectionfinishes. This also changes the error order in one test, which doesn't matter.The commit also changeds
emit_delayed_linttoemit_delayed_lints, factoring out some code duplicated in rustdoc.