Repository navigation
Suppress dead_code_pub_in_binary for library test units - #17608
Conversation
|
Error: Failed to set assignee to
Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip. |
8b46fde to
5f847b6
Compare
|
Thanks for the contribution, though note that we would love to see two things before the fix
OTOH, skimming through the issue and this PR, I couldn't tell how the current implementation fixes the issue. Anyway I'll put this back to draft. Please create an issue first. Thanks. |
|
This looks like we are passing in a crate type that is intended for the compiler to then ignore and use for diagnostic purposes? That feels wrong to me that the compiler is ignoring cargo's output, rather than erroring or respecting it. |
We respect |
|
opened issue #17619 for further discussion |
dbd1c0c to
9619817
Compare
|
reworked this to suppress the condition uses also updated the affected profile-selection snapshots. the focused tests pass locally. |
|
Thanks for the pull request, and welcome! The Rust Project has assigned @Urgau (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks. Please see the contribution instructions and our LLM policy for more information. |
|
|
updated the test coverage and split the change into two commits as requested. also tested all 4 regression tests and 11 profile-selection tests passed locally. will push and update title+description now, thank you |
9619817 to
ead7a0f
Compare
dead_code_pub_in_binary for library test units
7be7481 to
8bf7e19
Compare
8bf7e19 to
53fd05a
Compare
|
Thanks! |
|
thanks for reviewing :D |
…de-pub-in-binary-fixme, r=Urgau tests: clarify dead_code_pub_in_binary FIXME after Cargo workaround updating FIXME comment to reflect the workaround merged in rust-lang/cargo#17608. more on: rust-lang#164526 (comment) r? Urgau
…de-pub-in-binary-fixme, r=Urgau tests: clarify dead_code_pub_in_binary FIXME after Cargo workaround updating FIXME comment to reflect the workaround merged in rust-lang/cargo#17608. more on: rust-lang#164526 (comment) r? Urgau
…de-pub-in-binary-fixme, r=Urgau tests: clarify dead_code_pub_in_binary FIXME after Cargo workaround updating FIXME comment to reflect the workaround merged in rust-lang/cargo#17608. more on: rust-lang#164526 (comment) r? Urgau
Rollup merge of #165206 - paradoxicalguy:docs/update-dead-code-pub-in-binary-fixme, r=Urgau tests: clarify dead_code_pub_in_binary FIXME after Cargo workaround updating FIXME comment to reflect the workaround merged in rust-lang/cargo#17608. more on: #164526 (comment) r? Urgau
Update cargo submodule 13 commits in 31d3246e0e8d3a80d4a90b54aa48ff180adb408b..3c747ea3ead23951c1b43a5edfcbdb449135ddeb 2026-10-27 13:54:39 +0000 to 2026-11-03 21:25:31 +0000 - Link to `cargo search` result's crates.io pages (rust-lang/cargo#17668) - Clean `/out` dir before compilation (rust-lang/cargo#17675) - Allow `uncommon_codepoints` in confusable test (rust-lang/cargo#17676) - test: Update https certificate failed messages (rust-lang/cargo#17679) - chore(deps): update rust-lang/crates-io-auth-action action to v1.0.6 (rust-lang/cargo#17670) - chore(deps): update actions/deploy-pages action to v5.0.1 (rust-lang/cargo#17669) - Fix manifest schema generation: `TomlOptLevel` and `StringOrVec` (rust-lang/cargo#17660) - remove deprecated tempdir (rust-lang/cargo#17663) - chore(ci): remove Windows rustup PATH workaround (rust-lang/cargo#17667) - test: probe stable cargo through rustup (rust-lang/cargo#17666) - Update outdated registry function comments (rust-lang/cargo#17664) - perf(windows): Delay-load system DLLs that most commands don't use (rust-lang/cargo#17623) - Suppress `dead_code_pub_in_binary` for library test units (rust-lang/cargo#17608)
Update cargo submodule 13 commits in 31d3246e0e8d3a80d4a90b54aa48ff180adb408b..3c747ea3ead23951c1b43a5edfcbdb449135ddeb 2026-10-27 13:54:39 +0000 to 2026-11-03 21:25:31 +0000 - Link to `cargo search` result's crates.io pages (rust-lang/cargo#17668) - Clean `/out` dir before compilation (rust-lang/cargo#17675) - Allow `uncommon_codepoints` in confusable test (rust-lang/cargo#17676) - test: Update https certificate failed messages (rust-lang/cargo#17679) - chore(deps): update rust-lang/crates-io-auth-action action to v1.0.6 (rust-lang/cargo#17670) - chore(deps): update actions/deploy-pages action to v5.0.1 (rust-lang/cargo#17669) - Fix manifest schema generation: `TomlOptLevel` and `StringOrVec` (rust-lang/cargo#17660) - remove deprecated tempdir (rust-lang/cargo#17663) - chore(ci): remove Windows rustup PATH workaround (rust-lang/cargo#17667) - test: probe stable cargo through rustup (rust-lang/cargo#17666) - Update outdated registry function comments (rust-lang/cargo#17664) - perf(windows): Delay-load system DLLs that most commands don't use (rust-lang/cargo#17623) - Suppress `dead_code_pub_in_binary` for library test units (rust-lang/cargo#17608)
View all comments
what does this PR try to resolve?
fixes #17619. addresses rust-lang/rust#159078.
r-l/r pr: rust-lang/rust#164526
cargo check --all-targetsincorrectly triggersdead_code_pub_in_binaryfor unused public items in library unit tests.suppress the lint only for library test units, including
harness = false, while preserving it for binary and integration-test targets. suppression is added after user RUSTFLAGS, preventing ordinary lint-level flags from re-enabling the warning for library test units.how to test and review this PR
two commits: regression tests documenting the existing behavior, followed by the fix and updated snapshots.
tests cover library tests, custom test harnesses, and
RUSTFLAGSinteractions.locally verified: 4 regression tests and 11 profile-selection tests passed.