From a0f4e783fcf2c5942580d50199a5cae97085c150 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 29 Sep 2021 17:20:52 +0200 Subject: [PATCH] Remove lazy_static dependency --- src/librustdoc/core.rs | 6 +++--- 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 ddbe68762ee04..074744b3d11e2 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 5cfd21046f5d7..efc8e31498a9c 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;