Skip to content

[DRAFT] Skip check_mod_deathness when not needed - #160252

Draft
joshtriplett wants to merge 6 commits into
rust-lang:mainfrom
joshtriplett:skippable-check-mod-deathness
Draft

[DRAFT] Skip check_mod_deathness when not needed#160252
joshtriplett wants to merge 6 commits into
rust-lang:mainfrom
joshtriplett:skippable-check-mod-deathness

Conversation

@joshtriplett

Copy link
Copy Markdown
Member

Split out of #160126 because it caused (valid) test failures, and would need further rework.

Draft because I don't currently have the bandwidth to attempt that rework. Submitted so it doesn't get lost, in case it inspires any ideas.

Dependencies get built with `--cap-lints allow`, so there's value in
allowing capped lints to be skipped, even if the crate itself doesn't
allow them.
`late_lint_mod` constructs `LateContext` immediately, before figuring
out if the whole pass will be skipped. Move its construction into
`late_lint_mod_inner`, so it doesn't get called if the pass gets
skipped.
These lints will be skippable when building a crate with `--cap-lints
allow`, which occurs for every dependency crate. In such cases, we can
skip the whole query.
`-Zfuture-incompat-test` forces non-allow lints to report as
future-compat. Unfortunately, rather than doing so by modifying the
lints themselves, it requires checking separately. Check it and prevent
skipping lints if enabled.
These lints will be skippable when building a crate with `--cap-lints
allow`, which occurs for every dependency crate. In such cases, we can
skip the whole query.
@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. labels Jul 31, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job aarch64-gnu-llvm-21-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
error: ui test did not emit an error
note: by default, ui tests are expected not to compile.
hint: use check-pass, build-pass, or run-pass directive to change this behavior.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/recursion/issue-26548-recursion-via-normalize.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/recursion/issue-26548-recursion-via-normalize" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
stderr: none

---- [ui] tests/ui/recursion/issue-26548-recursion-via-normalize.rs stdout end ----
---- [ui] tests/ui/sized/stack-overflow-trait-infer-98842.rs stdout ----

error: ui test did not emit an error
note: by default, ui tests are expected not to compile.
hint: use check-pass, build-pass, or run-pass directive to change this behavior.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/sized/stack-overflow-trait-infer-98842.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/sized/stack-overflow-trait-infer-98842" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2021"
stdout: none
stderr: none

---- [ui] tests/ui/sized/stack-overflow-trait-infer-98842.rs stdout end ----

@rust-bors

rust-bors Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #160310) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

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. 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