diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index f71d62d5a04e1..ea1189e4a6d6a 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -4318,14 +4318,6 @@ where // Start of code copied from rust-clippy -pub fn get_trait_def_id(tcx: &TyCtxt, path: &[&str], use_local: bool) -> Option { - if use_local { - path_to_def_local(tcx, path) - } else { - path_to_def(tcx, path) - } -} - pub fn path_to_def_local(tcx: &TyCtxt, path: &[&str]) -> Option { let krate = tcx.hir.krate(); let mut items = krate.module.item_ids.clone(); diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 0a56c639220b4..2f372e690c3b5 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -360,9 +360,9 @@ pub fn run_core(search_paths: SearchPaths, }; let send_trait = if crate_name == Some("core".to_string()) { - clean::get_trait_def_id(&tcx, &["marker", "Send"], true) + clean::path_to_def_local(&tcx, &["marker", "Send"]) } else { - clean::get_trait_def_id(&tcx, &["core", "marker", "Send"], false) + clean::path_to_def(&tcx, &["core", "marker", "Send"]) }; let ctxt = DocContext { @@ -387,7 +387,7 @@ pub fn run_core(search_paths: SearchPaths, debug!("crate: {:?}", tcx.hir.krate()); let krate = { - let mut v = RustdocVisitor::new(&*cstore, &ctxt); + let mut v = RustdocVisitor::new(&ctxt); v.visit(tcx.hir.krate()); v.clean(&ctxt) }; diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index b7a9f95fdc0de..6e376d13cc567 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -21,7 +21,6 @@ use syntax_pos::{self, Span}; use rustc::hir::map as hir_map; use rustc::hir::def::Def; use rustc::hir::def_id::{DefId, LOCAL_CRATE}; -use rustc::middle::cstore::CrateStore; use rustc::middle::privacy::AccessLevel; use rustc::util::nodemap::{FxHashSet, FxHashMap}; @@ -40,7 +39,6 @@ use doctree::*; // framework from syntax? pub struct RustdocVisitor<'a, 'tcx: 'a, 'rcx: 'a> { - pub cstore: &'a CrateStore, pub module: Module, pub attrs: hir::HirVec, pub cx: &'a core::DocContext<'a, 'tcx, 'rcx>, @@ -52,8 +50,7 @@ pub struct RustdocVisitor<'a, 'tcx: 'a, 'rcx: 'a> { } impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> { - pub fn new(cstore: &'a CrateStore, - cx: &'a core::DocContext<'a, 'tcx, 'rcx>) -> RustdocVisitor<'a, 'tcx, 'rcx> { + pub fn new(cx: &'a core::DocContext<'a, 'tcx, 'rcx>) -> RustdocVisitor<'a, 'tcx, 'rcx> { // If the root is re-exported, terminate all recursion. let mut stack = FxHashSet(); stack.insert(ast::CRATE_NODE_ID); @@ -65,7 +62,6 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> { inlining: false, inside_public_path: true, exact_paths: Some(FxHashMap()), - cstore, } }