diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs
index f68e82501e91e..a5436886a7e8c 100644
--- a/src/librustdoc/html/markdown.rs
+++ b/src/librustdoc/html/markdown.rs
@@ -14,7 +14,7 @@
//! (bundled into the rust runtime). This module self-contains the C bindings
//! and necessary legwork to render markdown, and exposes all of the
//! functionality through a unit-struct, `Markdown`, which has an implementation
-//! of `fmt::String`. Example usage:
+//! of `fmt::Display`. Example usage:
//!
//! ```rust,ignore
//! use rustdoc::html::markdown::Markdown;
@@ -29,19 +29,19 @@
use libc;
use std::ascii::AsciiExt;
use std::cell::RefCell;
-use std::collections::HashMap;
use std::default::Default;
use std::ffi::CString;
use std::fmt;
use std::slice;
use std::str;
+use html::render::derive_id;
use html::toc::TocBuilder;
use html::highlight;
use html::escape::Escape;
use test;
-/// A unit struct which has the `fmt::String` trait implemented. When
+/// A unit struct which has the `fmt::Display` trait implemented. When
/// formatted, this struct will emit the HTML corresponding to the rendered
/// version of the contained markdown string.
pub struct Markdown<'a>(pub &'a str);
@@ -210,10 +210,6 @@ fn collapse_whitespace(s: &str) -> String {
s.split_whitespace().collect::>().join(" ")
}
-thread_local!(static USED_HEADER_MAP: RefCell> = {
- RefCell::new(HashMap::new())
-});
-
thread_local!(pub static PLAYGROUND_KRATE: RefCell