-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate using the unused crate rustc warning #70
Comments
@est31 I've tried that lint, and it seems to work well. I'd love to get a comparison of what |
The lint is enough for cases like buck where for each compilation unit you must specify the entire list of dependencies. For the cargo use case, one fundamentally can't implement something rustc side that works well: there is multiple compilation units that share a possible list of dependencies. A dependency can only be used by one of the compilation units. For the main
For the
For the
There is other questions like where the lint should point to: it should ideally point to the place in Cargo.toml that specifies the dependency. I think if one wants there to be a good check together with
Middle forms are possible, like adding There is the further complication that |
Does |
Frankly, I'd love to have this as an option someday. It'd be a massive tradeoff, but a huge win for a number of common cases. I'd love to have built-in udeps support before that, though. |
It doesn't, neither |
@est31 Ah, I didn't realize that. We should fix that; Would you consider filing (and nominating) an issue on cargo for building everything, with a link to the table you provided above? |
I've just recreated the table on the latest rustc, and it is like before (I've added some extra lines):
So it seems that For missing doctest support, there is already two issues in cargo, one for cargo check and one for cargo test. I've linked them in the original table but they were behind the Maybe one could unify the two issues into one: If the cargo team could make |
rustc PR rust-lang/rust#72342
Since the PR, rustc can be configured to emit unused crate warnings.
Suggested by ehuss here.
The text was updated successfully, but these errors were encountered: