Fix dead_code_pub_in_binary false positive on library crates - #159207
Fix dead_code_pub_in_binary false positive on library crates#159207Kokoro2336 wants to merge 1 commit into
dead_code_pub_in_binary false positive on library crates#159207Conversation
|
r? @jackh726 rustbot has assigned @jackh726. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Wasn't #74970 (comment) a somewhat important use case for this lint firing under After all, crates under tests are binaries with an auto-generated main function. However, this might be considered an implementation detail, so I understand the desire to change this. Ideally, we would have some replacement for the linked use case, then. Disclaimer: I've only skimmed everything so I might've missed something obvious. |
|
That test I mentioned there was a ui test, i.e. a regular binary crate -- no |
afb78c3 to
9e2fe0d
Compare
|
All the crates compiled with a |
|
Plus, I've supplied comparison tests between normal crate and library crate. |
|
The way the added tests look as they are now seems good to me, or at least the most intuitive at first glance. However, would it be possible to also include ones for other targets such as integration tests and examples? That would help ensure that unused public items in these would still get detected by the lint, which would make sense I think, as these effectively are separate binaries. |
|
I'm afraid this is not enough to fix #159078. I tried this locally with modified note, and I got: What I modified is: And |
Fixes #159078
Fix
dead_code_pub_in_binaryfalse positive on public items when compiling library crates with--all-targetsflag