-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Implement unused crate lint for 2018 edition #69203
Changes from all commits
278ea18
54034ce
e4170c4
3cfec9d
a87d6ba
cfd75fe
df71d38
bb0dac2
8bfbaf6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -30,8 +30,8 @@ use rustc_ast::ast::{self, Ident, Name}; | |||
use rustc_ast::node_id::{NodeId, NodeMap, NodeSet}; | ||||
use rustc_attr as attr; | ||||
use rustc_data_structures::captures::Captures; | ||||
use rustc_data_structures::fx::FxHashMap; | ||||
use rustc_data_structures::fx::FxIndexMap; | ||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet}; | ||||
use rustc_data_structures::sorted_map::SortedIndexMultiMap; | ||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; | ||||
use rustc_data_structures::sync::{self, par_iter, Lrc, ParallelIterator}; | ||||
|
@@ -136,6 +136,9 @@ pub struct ResolverOutputs { | |||
/// Extern prelude entries. The value is `true` if the entry was introduced | ||||
/// via `extern crate` item and not `--extern` option or compiler built-in. | ||||
pub extern_prelude: FxHashMap<Name, bool>, | ||||
/// All crates that ended up getting loaded. | ||||
/// Used to determine which `--extern` entries are unused | ||||
pub used_crates: Option<FxHashSet<Symbol>>, | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Putting this list into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @petrochenkov: Things are not actually done when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
How? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we find a previous crate when loading a crate: rust/src/librustc_metadata/creader.rs Line 522 in 1572c43
then we may map a different name in the extern prelude to an already loaded crate. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
} | ||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, HashStable)] | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.