Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
359bfa901b9d8eddbed7b88b6716dbb77b7bfb95
rust/tests/ui/unused-crate-deps/warn-cmdline-static.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
225 B
Rust
Raw Normal View History

Implement warning for unused dependencies. This will print a diagnostic for crates which are mentioned as `--extern` arguments on the command line, but are never referenced from the source. This diagnostic is controlled by `-Wunused-crate-dependencies` or `#![warn(unused_crate_dependencies)]` and is "allow" by default. There are cases where certain crates need to be linked in but are not directly referenced - for example if they are providing symbols for C linkage. In this case the warning can be suppressed with `use needed_crate as _;`. Thanks to @petrochenkov for simplified core. Resolves issue #57274
2020-05-17 01:48:01 -07:00
// Check for unused crate dep, no path
//@ edition:2018
//@ check-pass
//@ compile-flags: -Wunused-crate-dependencies
//@ aux-crate:bar=bar.rs
//@ no-prefer-dynamic
fn main() {}
Spruce up the diagnostics of some early lints
2024-06-03 07:17:19 +02:00
//~^ WARNING extern crate `bar` is unused in
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 2345ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API