Skip to content

Commit 55c11e3

Browse files
committed
Misc rustdoc changes
1 parent c0955a3 commit 55c11e3

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

src/librustdoc/clean/mod.rs

-8
Original file line numberDiff line numberDiff line change
@@ -4318,14 +4318,6 @@ where
43184318

43194319
// Start of code copied from rust-clippy
43204320

4321-
pub fn get_trait_def_id(tcx: &TyCtxt, path: &[&str], use_local: bool) -> Option<DefId> {
4322-
if use_local {
4323-
path_to_def_local(tcx, path)
4324-
} else {
4325-
path_to_def(tcx, path)
4326-
}
4327-
}
4328-
43294321
pub fn path_to_def_local(tcx: &TyCtxt, path: &[&str]) -> Option<DefId> {
43304322
let krate = tcx.hir.krate();
43314323
let mut items = krate.module.item_ids.clone();

src/librustdoc/core.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,9 @@ pub fn run_core(search_paths: SearchPaths,
360360
};
361361

362362
let send_trait = if crate_name == Some("core".to_string()) {
363-
clean::get_trait_def_id(&tcx, &["marker", "Send"], true)
363+
clean::path_to_def_local(&tcx, &["marker", "Send"])
364364
} else {
365-
clean::get_trait_def_id(&tcx, &["core", "marker", "Send"], false)
365+
clean::path_to_def(&tcx, &["core", "marker", "Send"])
366366
};
367367

368368
let ctxt = DocContext {
@@ -387,7 +387,7 @@ pub fn run_core(search_paths: SearchPaths,
387387
debug!("crate: {:?}", tcx.hir.krate());
388388

389389
let krate = {
390-
let mut v = RustdocVisitor::new(&*cstore, &ctxt);
390+
let mut v = RustdocVisitor::new(&ctxt);
391391
v.visit(tcx.hir.krate());
392392
v.clean(&ctxt)
393393
};

src/librustdoc/visit_ast.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use syntax_pos::{self, Span};
2121
use rustc::hir::map as hir_map;
2222
use rustc::hir::def::Def;
2323
use rustc::hir::def_id::{DefId, LOCAL_CRATE};
24-
use rustc::middle::cstore::CrateStore;
2524
use rustc::middle::privacy::AccessLevel;
2625
use rustc::util::nodemap::{FxHashSet, FxHashMap};
2726

@@ -40,7 +39,6 @@ use doctree::*;
4039
// framework from syntax?
4140

4241
pub struct RustdocVisitor<'a, 'tcx: 'a, 'rcx: 'a> {
43-
pub cstore: &'a CrateStore,
4442
pub module: Module,
4543
pub attrs: hir::HirVec<ast::Attribute>,
4644
pub cx: &'a core::DocContext<'a, 'tcx, 'rcx>,
@@ -52,8 +50,7 @@ pub struct RustdocVisitor<'a, 'tcx: 'a, 'rcx: 'a> {
5250
}
5351

5452
impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
55-
pub fn new(cstore: &'a CrateStore,
56-
cx: &'a core::DocContext<'a, 'tcx, 'rcx>) -> RustdocVisitor<'a, 'tcx, 'rcx> {
53+
pub fn new(cx: &'a core::DocContext<'a, 'tcx, 'rcx>) -> RustdocVisitor<'a, 'tcx, 'rcx> {
5754
// If the root is re-exported, terminate all recursion.
5855
let mut stack = FxHashSet();
5956
stack.insert(ast::CRATE_NODE_ID);
@@ -65,7 +62,6 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
6562
inlining: false,
6663
inside_public_path: true,
6764
exact_paths: Some(FxHashMap()),
68-
cstore,
6965
}
7066
}
7167

0 commit comments

Comments
 (0)