Rollup merge of #35618 - jseyfried:ast_view_path_refactor, r=eddyb

Refactor `PathListItem`s

This refactors away variant `Mod` of `ast::PathListItemKind` and refactors the remaining variant `Ident` to a struct `ast::PathListItem_`.
This commit is contained in:
Jeffrey Seyfried 2016-08-28 10:31:15 +00:00
commit 37f30173a0
21 changed files with 82 additions and 192 deletions

View file

@ -2551,7 +2551,7 @@ impl Clean<Vec<Item>> for doctree::Import {
let remaining = if !denied {
let mut remaining = vec![];
for path in list {
match inline::try_inline(cx, path.node.id(), path.node.rename()) {
match inline::try_inline(cx, path.node.id, path.node.rename) {
Some(items) => {
ret.extend(items);
}
@ -2619,17 +2619,10 @@ pub struct ViewListIdent {
impl Clean<ViewListIdent> for hir::PathListItem {
fn clean(&self, cx: &DocContext) -> ViewListIdent {
match self.node {
hir::PathListIdent { id, name, rename } => ViewListIdent {
name: name.clean(cx),
rename: rename.map(|r| r.clean(cx)),
source: resolve_def(cx, id)
},
hir::PathListMod { id, rename } => ViewListIdent {
name: "self".to_string(),
rename: rename.map(|r| r.clean(cx)),
source: resolve_def(cx, id)
}
ViewListIdent {
name: self.node.name.clean(cx),
rename: self.node.rename.map(|r| r.clean(cx)),
source: resolve_def(cx, self.node.id)
}
}
}

View file

@ -189,7 +189,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
}
hir::ViewPathList(p, paths) => {
let mine = paths.into_iter().filter(|path| {
!self.maybe_inline_local(path.node.id(), path.node.rename(),
!self.maybe_inline_local(path.node.id, path.node.rename,
false, om, please_inline)
}).collect::<hir::HirVec<hir::PathListItem>>();