diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2021-09-29 17:20:52 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2021-09-29 17:20:52 +0200 |
| commit | a0f4e783fcf2c5942580d50199a5cae97085c150 (patch) | |
| tree | 2ff14fc22644c517ef409c0da68842821ba2806a | |
| parent | 6df1d82869d06b88ff413e63a1e8efbb311e3b5c (diff) | |
| download | rust-a0f4e783fcf2c5942580d50199a5cae97085c150.tar.gz rust-a0f4e783fcf2c5942580d50199a5cae97085c150.zip | |
Remove lazy_static dependency
| -rw-r--r-- | src/librustdoc/core.rs | 6 | ||||
| -rw-r--r-- | src/librustdoc/lib.rs | 2 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index ddbe68762ee..074744b3d11 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -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 diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 5cfd21046f5..efc8e31498a 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -19,8 +19,6 @@ #![warn(rustc::internal)] #[macro_use] -extern crate lazy_static; -#[macro_use] extern crate tracing; // N.B. these need `extern crate` even in 2018 edition |
