Rollup merge of #89366 - GuillaumeGomez:remove-lazy-static, r=jyn514

rustdoc: Remove lazy_static dependency

The macro was used in only one place and there are equivalents in the std, so it seemed weird to keep it around...

I think running a perf check would be a good idea though, just in case.

r? ``@jyn514``
This commit is contained in:
Eric Huss 2021-09-29 19:33:43 -07:00 committed by GitHub
commit 9a77b21114
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View file

@ -25,6 +25,7 @@ use rustc_span::symbol::sym;
use rustc_span::Span;
use std::cell::RefCell;
use std::lazy::SyncLazy;
use std::mem;
use std::rc::Rc;
@ -271,9 +272,8 @@ crate fn create_config(
providers.typeck_item_bodies = |_, _| {};
// hack so that `used_trait_imports` won't try to call typeck
providers.used_trait_imports = |_, _| {
lazy_static! {
static ref EMPTY_SET: FxHashSet<LocalDefId> = FxHashSet::default();
}
static EMPTY_SET: SyncLazy<FxHashSet<LocalDefId>> =
SyncLazy::new(FxHashSet::default);
&EMPTY_SET
};
// In case typeck does end up being called, don't ICE in case there were name resolution errors

View file

@ -18,8 +18,6 @@
#![recursion_limit = "256"]
#![warn(rustc::internal)]
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate tracing;