diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 8c08f77667904..4dd79af56300f 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -496,8 +496,7 @@ impl Item { // Primitives and Keywords are written in the source code as private modules. // The modules need to be private so that nobody actually uses them, but the // keywords and primitives that they are documenting are public. - let visibility = if matches!(&kind, ItemKind::KeywordItem(..) | ItemKind::PrimitiveItem(..)) - { + let visibility = if matches!(&kind, ItemKind::KeywordItem | ItemKind::PrimitiveItem(..)) { Visibility::Public } else { cx.tcx.visibility(def_id).clean(cx) @@ -769,7 +768,7 @@ pub(crate) enum ItemKind { AssocTypeItem(Typedef, Vec), /// An item that has been stripped by a rustdoc pass StrippedItem(Box), - KeywordItem(Symbol), + KeywordItem, } impl ItemKind { @@ -808,7 +807,7 @@ impl ItemKind { | TyAssocTypeItem(..) | AssocTypeItem(..) | StrippedItem(_) - | KeywordItem(_) => [].iter(), + | KeywordItem => [].iter(), } } } diff --git a/src/librustdoc/clean/utils.rs b/src/librustdoc/clean/utils.rs index 22b1e2335fd84..fa449a21b0c93 100644 --- a/src/librustdoc/clean/utils.rs +++ b/src/librustdoc/clean/utils.rs @@ -69,7 +69,7 @@ pub(crate) fn krate(cx: &mut DocContext<'_>) -> Crate { ) })); m.items.extend(keywords.into_iter().map(|(def_id, kw)| { - Item::from_def_id_and_parts(def_id, Some(kw), ItemKind::KeywordItem(kw), cx) + Item::from_def_id_and_parts(def_id, Some(kw), ItemKind::KeywordItem, cx) })); } diff --git a/src/librustdoc/fold.rs b/src/librustdoc/fold.rs index 336448904d165..c93897236db69 100644 --- a/src/librustdoc/fold.rs +++ b/src/librustdoc/fold.rs @@ -69,7 +69,7 @@ pub(crate) trait DocFolder: Sized { | AssocConstItem(..) | TyAssocTypeItem(..) | AssocTypeItem(..) - | KeywordItem(_) => kind, + | KeywordItem => kind, } } diff --git a/src/librustdoc/formats/cache.rs b/src/librustdoc/formats/cache.rs index d7276a427c468..b9774eb70ea02 100644 --- a/src/librustdoc/formats/cache.rs +++ b/src/librustdoc/formats/cache.rs @@ -413,7 +413,7 @@ impl<'a, 'tcx> DocFolder for CacheBuilder<'a, 'tcx> { | clean::TyAssocTypeItem(..) | clean::AssocTypeItem(..) | clean::StrippedItem(..) - | clean::KeywordItem(..) => { + | clean::KeywordItem => { // FIXME: Do these need handling? // The person writing this comment doesn't know. // So would rather leave them to an expert, diff --git a/src/librustdoc/formats/item_type.rs b/src/librustdoc/formats/item_type.rs index 9cb3327d7c781..0a7ee2005915b 100644 --- a/src/librustdoc/formats/item_type.rs +++ b/src/librustdoc/formats/item_type.rs @@ -91,7 +91,7 @@ impl<'a> From<&'a clean::Item> for ItemType { clean::TyAssocConstItem(..) | clean::AssocConstItem(..) => ItemType::AssocConst, clean::TyAssocTypeItem(..) | clean::AssocTypeItem(..) => ItemType::AssocType, clean::ForeignTypeItem => ItemType::ForeignType, - clean::KeywordItem(..) => ItemType::Keyword, + clean::KeywordItem => ItemType::Keyword, clean::TraitAliasItem(..) => ItemType::TraitAlias, clean::ProcMacroItem(ref mac) => match mac.kind { MacroKind::Bang => ItemType::Macro, diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index daacc57a55a3a..0cee114b346b2 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -104,7 +104,7 @@ pub(super) fn print_item( clean::StaticItem(..) | clean::ForeignStaticItem(..) => "Static ", clean::ConstantItem(..) => "Constant ", clean::ForeignTypeItem => "Foreign Type ", - clean::KeywordItem(..) => "Keyword ", + clean::KeywordItem => "Keyword ", clean::OpaqueTyItem(..) => "Opaque Type ", clean::TraitAliasItem(..) => "Trait Alias ", _ => { @@ -175,7 +175,7 @@ pub(super) fn print_item( clean::StaticItem(ref i) | clean::ForeignStaticItem(ref i) => item_static(buf, cx, item, i), clean::ConstantItem(ref c) => item_constant(buf, cx, item, c), clean::ForeignTypeItem => item_foreign_type(buf, cx, item), - clean::KeywordItem(_) => item_keyword(buf, cx, item), + clean::KeywordItem => item_keyword(buf, cx, item), clean::OpaqueTyItem(ref e) => item_opaque_ty(buf, cx, item, e), clean::TraitAliasItem(ref ta) => item_trait_alias(buf, cx, item, ta), _ => { diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs index 9000ab472d96e..418d7c8353513 100644 --- a/src/librustdoc/json/conversions.rs +++ b/src/librustdoc/json/conversions.rs @@ -43,7 +43,7 @@ impl JsonRenderer<'_> { let span = item.span(self.tcx); let clean::Item { name, attrs: _, kind: _, visibility, item_id, cfg: _ } = item; let inner = match *item.kind { - clean::KeywordItem(_) => return None, + clean::KeywordItem => return None, clean::StrippedItem(ref inner) => { match &**inner { // We document non-empty stripped modules as with `Module::is_stripped` set to @@ -269,7 +269,7 @@ fn from_clean_item(item: clean::Item, tcx: TyCtxt<'_>) -> ItemEnum { default: Some(t.item_type.unwrap_or(t.type_).into_tcx(tcx)), }, // `convert_item` early returns `None` for stripped items and keywords. - KeywordItem(_) => unreachable!(), + KeywordItem => unreachable!(), StrippedItem(inner) => { match *inner { ModuleItem(m) => ItemEnum::Module(Module { diff --git a/src/librustdoc/passes/check_doc_test_visibility.rs b/src/librustdoc/passes/check_doc_test_visibility.rs index 735a077fe1f6b..e80a94fe749de 100644 --- a/src/librustdoc/passes/check_doc_test_visibility.rs +++ b/src/librustdoc/passes/check_doc_test_visibility.rs @@ -69,7 +69,7 @@ pub(crate) fn should_have_doc_example(cx: &DocContext<'_>, item: &clean::Item) - | clean::ExternCrateItem { .. } | clean::ImportItem(_) | clean::PrimitiveItem(_) - | clean::KeywordItem(_) + | clean::KeywordItem // check for trait impl | clean::ImplItem(clean::Impl { trait_: Some(_), .. }) ) diff --git a/src/librustdoc/passes/stripper.rs b/src/librustdoc/passes/stripper.rs index 5f2f50e712b53..0d419042a10a4 100644 --- a/src/librustdoc/passes/stripper.rs +++ b/src/librustdoc/passes/stripper.rs @@ -98,7 +98,7 @@ impl<'a> DocFolder for Stripper<'a> { clean::PrimitiveItem(..) => {} // Keywords are never stripped - clean::KeywordItem(..) => {} + clean::KeywordItem => {} } let fastreturn = match *i.kind { diff --git a/src/librustdoc/visit.rs b/src/librustdoc/visit.rs index 75e1dd41a63e3..0bb41977c97ca 100644 --- a/src/librustdoc/visit.rs +++ b/src/librustdoc/visit.rs @@ -43,7 +43,7 @@ pub(crate) trait DocVisitor: Sized { | AssocConstItem(..) | TyAssocTypeItem(..) | AssocTypeItem(..) - | KeywordItem(_) => {} + | KeywordItem => {} } }