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 = FxHashSet::default(); - } + static EMPTY_SET: SyncLazy> = + 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 @@ -18,8 +18,6 @@ #![recursion_limit = "256"] #![warn(rustc::internal)] -#[macro_use] -extern crate lazy_static; #[macro_use] extern crate tracing;