about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNoah Lev <camelidcamel@gmail.com>2023-08-23 11:47:35 -0700
committerNoah Lev <camelidcamel@gmail.com>2023-08-23 11:47:35 -0700
commitd4ab99d946590e5d62a0aafc0e8fd1d4605e4bc6 (patch)
tree29e801250d2c6356662b77a7141815b6f76fd671
parent4d9ac5df59f400e76ce7532fa1b6b459d4a1c70c (diff)
downloadrust-d4ab99d946590e5d62a0aafc0e8fd1d4605e4bc6.tar.gz
rust-d4ab99d946590e5d62a0aafc0e8fd1d4605e4bc6.zip
rustdoc: Rename typedef to type alias in jsondoclint
-rw-r--r--src/tools/jsondoclint/src/item_kind.rs12
-rw-r--r--src/tools/jsondoclint/src/validator.rs8
2 files changed, 10 insertions, 10 deletions
diff --git a/src/tools/jsondoclint/src/item_kind.rs b/src/tools/jsondoclint/src/item_kind.rs
index d48e6533a20..9bd04e11cb3 100644
--- a/src/tools/jsondoclint/src/item_kind.rs
+++ b/src/tools/jsondoclint/src/item_kind.rs
@@ -12,7 +12,7 @@ pub(crate) enum Kind {
     Enum,
     Variant,
     Function,
-    Typedef,
+    TypeAlias,
     OpaqueTy,
     Constant,
     Trait,
@@ -45,7 +45,7 @@ impl Kind {
             Trait => true,
             TraitAlias => true,
             Impl => true,
-            Typedef => true,
+            TypeAlias => true,
             Constant => true,
             Static => true,
             Macro => true,
@@ -98,7 +98,7 @@ impl Kind {
             Kind::Union => false,
             Kind::Enum => false,
             Kind::Variant => false,
-            Kind::Typedef => false,
+            Kind::TypeAlias => false,
             Kind::OpaqueTy => false,
             Kind::Constant => false,
             Kind::Trait => false,
@@ -131,7 +131,7 @@ impl Kind {
         matches!(self, Kind::Trait | Kind::TraitAlias)
     }
     pub fn is_type(self) -> bool {
-        matches!(self, Kind::Struct | Kind::Enum | Kind::Union | Kind::Typedef)
+        matches!(self, Kind::Struct | Kind::Enum | Kind::Union | Kind::TypeAlias)
     }
 
     pub fn from_item(i: &Item) -> Self {
@@ -148,7 +148,7 @@ impl Kind {
             ItemEnum::Trait(_) => Trait,
             ItemEnum::TraitAlias(_) => TraitAlias,
             ItemEnum::Impl(_) => Impl,
-            ItemEnum::TypeAlias(_) => Typedef,
+            ItemEnum::TypeAlias(_) => TypeAlias,
             ItemEnum::OpaqueTy(_) => OpaqueTy,
             ItemEnum::Constant(_) => Constant,
             ItemEnum::Static(_) => Static,
@@ -186,7 +186,7 @@ impl Kind {
             ItemKind::StructField => StructField,
             ItemKind::Trait => Trait,
             ItemKind::TraitAlias => TraitAlias,
-            ItemKind::TypeAlias => Typedef,
+            ItemKind::TypeAlias => TypeAlias,
             ItemKind::Union => Union,
             ItemKind::Variant => Variant,
         }
diff --git a/src/tools/jsondoclint/src/validator.rs b/src/tools/jsondoclint/src/validator.rs
index 79b1551f301..592e97310a4 100644
--- a/src/tools/jsondoclint/src/validator.rs
+++ b/src/tools/jsondoclint/src/validator.rs
@@ -37,7 +37,7 @@ pub struct Validator<'a> {
 
 enum PathKind {
     Trait,
-    /// Structs, Enums, Unions and Typedefs.
+    /// Structs, Enums, Unions and TypeAliases.
     ///
     /// This doesn't include trait's because traits are not types.
     Type,
@@ -99,7 +99,7 @@ impl<'a> Validator<'a> {
                 ItemEnum::Trait(x) => self.check_trait(x, id),
                 ItemEnum::TraitAlias(x) => self.check_trait_alias(x),
                 ItemEnum::Impl(x) => self.check_impl(x, id),
-                ItemEnum::TypeAlias(x) => self.check_typedef(x),
+                ItemEnum::TypeAlias(x) => self.check_type_alias(x),
                 ItemEnum::OpaqueTy(x) => self.check_opaque_ty(x),
                 ItemEnum::Constant(x) => self.check_constant(x),
                 ItemEnum::Static(x) => self.check_static(x),
@@ -221,7 +221,7 @@ impl<'a> Validator<'a> {
         }
     }
 
-    fn check_typedef(&mut self, x: &'a TypeAlias) {
+    fn check_type_alias(&mut self, x: &'a TypeAlias) {
         self.check_generics(&x.generics);
         self.check_type(&x.type_);
     }
@@ -450,7 +450,7 @@ impl<'a> Validator<'a> {
     }
 
     fn add_type_id(&mut self, id: &'a Id) {
-        self.add_id_checked(id, Kind::is_type, "Type (Struct, Enum, Union or Typedef)");
+        self.add_id_checked(id, Kind::is_type, "Type (Struct, Enum, Union or TypeAlias)");
     }
 
     /// Add an Id that appeared in a trait