Skip to content

Commit 0e1ff40

Browse files
committed
Remove CURRENT_DEPTH
Hooray!
1 parent 80a0dc2 commit 0e1ff40

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

src/librustdoc/html/render/context.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use super::print_item::{full_path, item_path, print_item};
1919
use super::write_shared::write_shared;
2020
use super::{
2121
print_sidebar, settings, AllTypes, NameDoc, SharedContext, StylePath, BASIC_KEYWORDS,
22-
CURRENT_DEPTH, INITIAL_IDS,
22+
INITIAL_IDS,
2323
};
2424

2525
use crate::clean::{self, AttributesExt};
@@ -106,12 +106,6 @@ impl<'tcx> Context<'tcx> {
106106
}
107107

108108
fn render_item(&self, it: &clean::Item, pushname: bool) -> String {
109-
// A little unfortunate that this is done like this, but it sure
110-
// does make formatting *a lot* nicer.
111-
CURRENT_DEPTH.with(|slot| {
112-
slot.set(self.current.len());
113-
});
114-
115109
let mut title = if it.is_primitive() || it.is_keyword() {
116110
// No need to include the namespace for primitive types and keywords
117111
String::new()
@@ -422,8 +416,6 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
422416
redirections: if generate_redirect_map { Some(Default::default()) } else { None },
423417
};
424418

425-
CURRENT_DEPTH.with(|s| s.set(0));
426-
427419
// Write shared runs within a flock; disable thread dispatching of IO temporarily.
428420
Arc::get_mut(&mut cx.shared).unwrap().fs.set_sync_only(true);
429421
write_shared(&cx, &krate, index, &md_opts)?;

src/librustdoc/html/render/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ mod write_shared;
3434

3535
crate use context::*;
3636

37-
use std::cell::{Cell, RefCell};
37+
use std::cell::RefCell;
3838
use std::collections::VecDeque;
3939
use std::default::Default;
4040
use std::fmt;
@@ -291,8 +291,6 @@ crate struct StylePath {
291291
crate disabled: bool,
292292
}
293293

294-
thread_local!(crate static CURRENT_DEPTH: Cell<usize> = Cell::new(0));
295-
296294
crate const INITIAL_IDS: [&'static str; 15] = [
297295
"main",
298296
"search",

0 commit comments

Comments
 (0)