Skip to content

Commit

Permalink
Rollup merge of rust-lang#89366 - GuillaumeGomez:remove-lazy-static, …
Browse files Browse the repository at this point in the history
…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``
  • Loading branch information
ehuss authored Sep 30, 2021
2 parents 8f9f3aa + a0f4e78 commit 9a77b21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/librustdoc/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
#![recursion_limit = "256"]
#![warn(rustc::internal)]

#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate tracing;

Expand Down

0 comments on commit 9a77b21

Please sign in to comment.