diff options
| author | varkor <github@varkor.com> | 2019-09-26 17:51:36 +0100 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-09-26 18:21:48 +0100 |
| commit | 7bc94cc3c2ccef8b4d393910bb978a6487db1202 (patch) | |
| tree | 1c7a5175d795992497651e7dfa3e3a0f76f5815a /src/librustdoc | |
| parent | 21bf983acbb5d7ac8fb9462cbf2cc4c280abd857 (diff) | |
Rename `Item.node` to `Item.kind`
Diffstat (limited to 'src/librustdoc')
| -rw-r--r-- | src/librustdoc/clean/inline.rs | 6 | ||||
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 8 | ||||
| -rw-r--r-- | src/librustdoc/test.rs | 8 | ||||
| -rw-r--r-- | src/librustdoc/visit_ast.rs | 4 |
4 files changed, 13 insertions, 13 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index 479c8c37283..532c5f67bf3 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -333,7 +333,7 @@ pub fn build_impl(cx: &DocContext<'_>, did: DefId, attrs: Option<Attrs<'_>>, } let for_ = if let Some(hir_id) = tcx.hir().as_local_hir_id(did) { - match tcx.hir().expect_item(hir_id).node { + match tcx.hir().expect_item(hir_id).kind { hir::ItemKind::Impl(.., ref t, _) => { t.clean(cx) } @@ -355,7 +355,7 @@ pub fn build_impl(cx: &DocContext<'_>, did: DefId, attrs: Option<Attrs<'_>>, let predicates = tcx.explicit_predicates_of(did); let (trait_items, generics) = if let Some(hir_id) = tcx.hir().as_local_hir_id(did) { - match tcx.hir().expect_item(hir_id).node { + match tcx.hir().expect_item(hir_id).kind { hir::ItemKind::Impl(.., ref gen, _, _, ref item_ids) => { ( item_ids.iter() @@ -481,7 +481,7 @@ fn build_macro(cx: &DocContext<'_>, did: DefId, name: ast::Name) -> clean::ItemE let imported_from = cx.tcx.original_crate_name(did.krate); match cx.cstore.load_macro_untracked(did, cx.sess()) { LoadedMacro::MacroDef(def) => { - let matchers: hir::HirVec<Span> = if let ast::ItemKind::MacroDef(ref def) = def.node { + let matchers: hir::HirVec<Span> = if let ast::ItemKind::MacroDef(ref def) = def.kind { let tts: Vec<_> = def.stream().into_trees().collect(); tts.chunks(4).map(|arm| arm[0].span()).collect() } else { diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 161b1a996a9..026a76f0894 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -275,7 +275,7 @@ impl Clean<ExternalCrate> for CrateNum { let primitives = if root.is_local() { cx.tcx.hir().krate().module.item_ids.iter().filter_map(|&id| { let item = cx.tcx.hir().expect_item(id.id); - match item.node { + match item.kind { hir::ItemKind::Mod(_) => { as_primitive(Res::Def( DefKind::Mod, @@ -319,7 +319,7 @@ impl Clean<ExternalCrate> for CrateNum { let keywords = if root.is_local() { cx.tcx.hir().krate().module.item_ids.iter().filter_map(|&id| { let item = cx.tcx.hir().expect_item(id.id); - match item.node { + match item.kind { hir::ItemKind::Mod(_) => { as_keyword(Res::Def( DefKind::Mod, @@ -2868,7 +2868,7 @@ impl Clean<Type> for hir::Ty { TyKind::Tup(ref tys) => Tuple(tys.clean(cx)), TyKind::Def(item_id, _) => { let item = cx.tcx.hir().expect_item(item_id.id); - if let hir::ItemKind::OpaqueTy(ref ty) = item.node { + if let hir::ItemKind::OpaqueTy(ref ty) = item.kind { ImplTrait(ty.bounds.clean(cx)) } else { unreachable!() @@ -2889,7 +2889,7 @@ impl Clean<Type> for hir::Ty { // Substitute private type aliases if let Some(hir_id) = cx.tcx.hir().as_local_hir_id(def_id) { if !cx.renderinfo.borrow().access_levels.is_exported(def_id) { - alias = Some(&cx.tcx.hir().expect_item(hir_id).node); + alias = Some(&cx.tcx.hir().expect_item(hir_id).kind); } } }; diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index 424239c9982..6576165b6ce 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -425,7 +425,7 @@ pub fn make_test(s: &str, match parser.parse_item() { Ok(Some(item)) => { if !found_main { - if let ast::ItemKind::Fn(..) = item.node { + if let ast::ItemKind::Fn(..) = item.kind { if item.ident.name == sym::main { found_main = true; } @@ -433,7 +433,7 @@ pub fn make_test(s: &str, } if !found_extern_crate { - if let ast::ItemKind::ExternCrate(original) = item.node { + if let ast::ItemKind::ExternCrate(original) = item.kind { // This code will never be reached if `cratename` is none because // `found_extern_crate` is initialized to `true` if it is none. let cratename = cratename.unwrap(); @@ -446,7 +446,7 @@ pub fn make_test(s: &str, } if !found_macro { - if let ast::ItemKind::Mac(..) = item.node { + if let ast::ItemKind::Mac(..) = item.kind { found_macro = true; } } @@ -882,7 +882,7 @@ impl<'a, 'hir> intravisit::Visitor<'hir> for HirCollector<'a, 'hir> { } fn visit_item(&mut self, item: &'hir hir::Item) { - let name = if let hir::ItemKind::Impl(.., ref ty, _) = item.node { + let name = if let hir::ItemKind::Impl(.., ref ty, _) = item.kind { self.map.hir_to_pretty_string(ty.hir_id) } else { item.ident.to_string() diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index ee330cb3211..8cf5fbe849f 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -320,7 +320,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { if !self.view_item_stack.insert(res_hir_id) { return false } let ret = match tcx.hir().get(res_hir_id) { - Node::Item(&hir::Item { node: hir::ItemKind::Mod(ref m), .. }) if glob => { + Node::Item(&hir::Item { kind: hir::ItemKind::Mod(ref m), .. }) if glob => { let prev = mem::replace(&mut self.inlining, true); for i in &m.item_ids { let i = self.cx.tcx.hir().expect_item(i.id); @@ -361,7 +361,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { self.store_path(def_id); } - match item.node { + match item.kind { hir::ItemKind::ForeignMod(ref fm) => { for item in &fm.items { self.visit_foreign_item(item, None, om); |
