Skip to content

rustdoc: Remove lazy_static dependency #89366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/librustdoc/core.rs
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
@@ -18,8 +18,6 @@
#![recursion_limit = "256"]
#![warn(rustc::internal)]

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