You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Oh, I had no idea. I saw it in the list and thought it was a reasonable way for an ordinary person writing a Rust library or program to be made aware of crates they accidentally depended on but then later stopped using. From your description in that PR, it sounds like once the warning is ready it will be enabled by default, so I should remove the #![warn(unused_crate_dependencies)] from my source; is that right?
Yes, once the PR is merged, the lint itself is suppressed on the rustc side and instead rustc sends info that cargo can digest, and then cargo emits the lint instead. The level is still sent by rustc so you can still control it with adding a #![warn(...)] thing. Also yes, the goal is to eventually enable it by default, but I want to be a bit more careful with it and first let users opt into it. Then later once it's known that there are no bugs, it can be enabled.
You can remove the warn, or keep it in, it's your choice.
If a dependency is only used in a doctest, it triggers an
unused_crate_dependencies
false positive.I tried this code:
main.rs
:cargo.Toml
:I expected to see this happen: No warnings.
Instead, this happened:
cargo test
generates anunused_crate_dependencies
warning for thegcd
crate.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: