about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-05-26 22:11:29 +0200
committerGitHub <noreply@github.com>2020-05-26 22:11:29 +0200
commite38fdda243c890bc8f4ce93eb82fd1bf750ebbe7 (patch)
treea9654d285094708c102d3a980c6013c0d75bf612 /src/libstd/sys/unix/stack_overflow.rs
parent0747f586ebada402e2b2d5cb14ab40d5f33518a6 (diff)
parentffa493ab57fbb44f16efae2515abdde6876cc5c9 (diff)
downloadrust-e38fdda243c890bc8f4ce93eb82fd1bf750ebbe7.tar.gz
rust-e38fdda243c890bc8f4ce93eb82fd1bf750ebbe7.zip
Rollup merge of #72342 - jsgf:warn-unused-deps, r=petrochenkov
Warn about unused crate deps

Implements #57274 by adding -Wunused-crate-dependencies. This will warn about any `--extern` option on the command line which isn't referenced by the crate source either via `use` or `extern crate`.

Crates which are added for some side effect but are otherwise unreferenced - such as for symbols they define - the warning can be suppressed with `use somecrate as _;`.

If a crate has multiple aliases (eg using `foo = { package = "bar" }` in `Cargo.toml`), then it will warn about each unused alias.

This does not consider crate added by some other means than `--extern`, including the standard library. It also doesn't consider any crate without `add_prelude` set (though I'm not sure about this).

Unfortunately this probably [does not yet work well with Cargo](https://github.com/rust-lang/rust/issues/57274#issuecomment-624839355) as it will over-specify crates, causing spurious warnings. As a result, this lint is "allow" by default and must be explicitly enabled either via `#![warn(unused_crate_deps)]` or with `-Wunused-crate-deps`.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions