diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 54cf82a19b4..98684b27973 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -4435,14 +4435,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 5872c8da1a4..6e1b4589547 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -362,9 +362,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 { @@ -390,7 +390,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 267b7000948..09d304b71a2 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, } }