summary refs log tree commit diff
path: root/src/librustdoc/html/render
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2021-04-17 22:34:58 -0700
committerMichael Howell <michael@notriddle.com>2021-04-17 23:08:28 -0700
commit18fbd3692fc441282f738e0fc0a5ee04f16aef53 (patch)
tree698ce4469839f5c645ed1688aa45a4af4288ce93 /src/librustdoc/html/render
parent755b4fb02b2a1fcc7d1e2163d1b4b370699788c9 (diff)
downloadrust-18fbd3692fc441282f738e0fc0a5ee04f16aef53.tar.gz
rust-18fbd3692fc441282f738e0fc0a5ee04f16aef53.zip
rustdoc: get rid of CURRENT_DEPTH
Diffstat (limited to 'src/librustdoc/html/render')
-rw-r--r--src/librustdoc/html/render/context.rs10
-rw-r--r--src/librustdoc/html/render/mod.rs3
2 files changed, 1 insertions, 12 deletions
diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs
index d866cf4f4cf..05d20013859 100644
--- a/src/librustdoc/html/render/context.rs
+++ b/src/librustdoc/html/render/context.rs
@@ -16,7 +16,7 @@ use rustc_span::{symbol::sym, Symbol};
 use super::cache::{build_index, ExternalLocation};
 use super::print_item::{full_path, item_path, print_item};
 use super::write_shared::write_shared;
-use super::{print_sidebar, settings, AllTypes, NameDoc, StylePath, BASIC_KEYWORDS, CURRENT_DEPTH};
+use super::{print_sidebar, settings, AllTypes, NameDoc, StylePath, BASIC_KEYWORDS};
 
 use crate::clean::{self, AttributesExt};
 use crate::config::RenderOptions;
@@ -168,12 +168,6 @@ impl<'tcx> Context<'tcx> {
     }
 
     fn render_item(&self, it: &clean::Item, pushname: bool) -> String {
-        // A little unfortunate that this is done like this, but it sure
-        // does make formatting *a lot* nicer.
-        CURRENT_DEPTH.with(|slot| {
-            slot.set(self.current.len());
-        });
-
         let mut title = if it.is_primitive() || it.is_keyword() {
             // No need to include the namespace for primitive types and keywords
             String::new()
@@ -482,8 +476,6 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
             cache: Rc::new(cache),
         };
 
-        CURRENT_DEPTH.with(|s| s.set(0));
-
         // Write shared runs within a flock; disable thread dispatching of IO temporarily.
         Rc::get_mut(&mut cx.shared).unwrap().fs.set_sync_only(true);
         write_shared(&cx, &krate, index, &md_opts)?;
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index d10b612a737..8b5e1aa1817 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -35,7 +35,6 @@ mod write_shared;
 crate use context::*;
 crate use write_shared::FILES_UNVERSIONED;
 
-use std::cell::Cell;
 use std::collections::VecDeque;
 use std::default::Default;
 use std::fmt;
@@ -209,8 +208,6 @@ crate struct StylePath {
     crate disabled: bool,
 }
 
-thread_local!(crate static CURRENT_DEPTH: Cell<usize> = Cell::new(0));
-
 fn write_srclink(cx: &Context<'_>, item: &clean::Item, buf: &mut Buffer) {
     if let Some(l) = cx.src_href(item) {
         write!(buf, "<a class=\"srclink\" href=\"{}\" title=\"goto source code\">[src]</a>", l)