EMPTY_MAP -> EMPTY_SET

This commit is contained in:
Joshua Nelson 2020-07-11 20:54:47 -04:00
parent b2ff0e703e
commit ac9157b482

View file

@ -364,9 +364,6 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
..Options::default()
};
lazy_static! {
static ref EMPTY_MAP: FxHashSet<LocalDefId> = FxHashSet::default();
}
let config = interface::Config {
opts: sessopts,
crate_cfg: interface::parse_cfgspecs(cfgs),
@ -381,12 +378,15 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
lint_caps,
register_lints: None,
override_queries: Some(|_sess, local_providers, external_providers| {
lazy_static! {
static ref EMPTY_SET: FxHashSet<LocalDefId> = FxHashSet::default();
}
// Most lints will require typechecking, so just don't run them.
local_providers.lint_mod = |_, _| {};
external_providers.lint_mod = |_, _| {};
local_providers.typeck_item_bodies = |_, _| {};
// hack so that `used_trait_imports` won't try to call typeck_tables_of
local_providers.used_trait_imports = |_, _| &EMPTY_MAP;
local_providers.used_trait_imports = |_, _| &EMPTY_SET;
// In case typeck does end up being called, don't ICE in case there were name resolution errors
local_providers.typeck_tables_of = move |tcx, def_id| {
// Closures' tables come from their outermost function,