diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 9220d2feed2d..f7e8cdeaeca8 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -1069,8 +1069,6 @@ themePicker.onblur = handleThemeButtonsBlur;
}
if cx.shared.include_sources {
- use std::path::Component;
-
let mut hierarchy = Hierarchy::new(OsString::new());
for source in cx.shared.local_sources.iter()
.filter_map(|p| p.0.strip_prefix(&cx.shared.src_root)
diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs
index f1d4d8470b2a..0bbc7c5c4b22 100644
--- a/src/librustdoc/test.rs
+++ b/src/librustdoc/test.rs
@@ -371,8 +371,7 @@ pub fn make_test(s: &str,
// Uses libsyntax to parse the doctest and find if there's a main fn and the extern
// crate already is included.
let (already_has_main, already_has_extern_crate, found_macro) = crate::syntax::with_globals(|| {
- use crate::syntax::{ast, parse::{self, ParseSess}, source_map::FilePathMapping};
- use crate::syntax_pos::FileName;
+ use crate::syntax::{parse::{self, ParseSess}, source_map::FilePathMapping};
use errors::emitter::EmitterWriter;
use errors::Handler;