]> git.lizzy.rs Git - rust.git/commitdiff
Rename `ItemKind::Ty` to `ItemKind::TyAlias`
authorvarkor <github@varkor.com>
Fri, 2 Aug 2019 10:02:08 +0000 (11:02 +0100)
committervarkor <github@varkor.com>
Sun, 4 Aug 2019 19:13:37 +0000 (20:13 +0100)
31 files changed:
src/librustc/hir/check_attr.rs
src/librustc/hir/intravisit.rs
src/librustc/hir/lowering.rs
src/librustc/hir/map/def_collector.rs
src/librustc/hir/map/mod.rs
src/librustc/hir/mod.rs
src/librustc/hir/print.rs
src/librustc/middle/dead.rs
src/librustc/middle/reachable.rs
src/librustc/middle/resolve_lifetime.rs
src/librustc_incremental/persist/dirty_clean.rs
src/librustc_lint/builtin.rs
src/librustc_lint/nonstandard_style.rs
src/librustc_metadata/encoder.rs
src/librustc_mir/monomorphize/collector.rs
src/librustc_passes/layout_test.rs
src/librustc_privacy/lib.rs
src/librustc_resolve/build_reduced_graph.rs
src/librustc_resolve/lib.rs
src/librustc_save_analysis/dump_visitor.rs
src/librustc_save_analysis/sig.rs
src/librustc_typeck/check/mod.rs
src/librustc_typeck/collect.rs
src/librustdoc/clean/mod.rs
src/librustdoc/visit_ast.rs
src/libsyntax/ast.rs
src/libsyntax/ext/build.rs
src/libsyntax/mut_visit.rs
src/libsyntax/parse/parser.rs
src/libsyntax/print/pprust.rs
src/libsyntax/visit.rs

index db90e44b892563c8d34de3bcebd02554a8e18614..b6cd173fbd1b7551279aa281aa481e5765622148 100644 (file)
@@ -75,7 +75,7 @@ pub(crate) fn from_item(item: &hir::Item) -> Target {
             hir::ItemKind::Mod(..) => Target::Mod,
             hir::ItemKind::ForeignMod(..) => Target::ForeignMod,
             hir::ItemKind::GlobalAsm(..) => Target::GlobalAsm,
-            hir::ItemKind::Ty(..) => Target::Ty,
+            hir::ItemKind::TyAlias(..) => Target::TyAlias,
             hir::ItemKind::OpaqueTy(..) => Target::OpaqueTy,
             hir::ItemKind::Enum(..) => Target::Enum,
             hir::ItemKind::Struct(..) => Target::Struct,
index 625e746c24fec0b15a5f58bf7b37025d93ddf75f..1e569009edb46e657148c8fdbe856636f609afb0 100644 (file)
@@ -500,7 +500,7 @@ pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item) {
         ItemKind::GlobalAsm(_) => {
             visitor.visit_id(item.hir_id);
         }
-        ItemKind::Ty(ref ty, ref generics) => {
+        ItemKind::TyAlias(ref ty, ref generics) => {
             visitor.visit_id(item.hir_id);
             visitor.visit_ty(ty);
             visitor.visit_generics(generics)
index f76de96cd10dae141198766fc8601e82b9fb1895..8a549518f04845c3ecaa4f9863840e514814cd86 100644 (file)
@@ -486,7 +486,7 @@ fn visit_item(&mut self, item: &'tcx Item) {
                     ItemKind::Struct(_, ref generics)
                     | ItemKind::Union(_, ref generics)
                     | ItemKind::Enum(_, ref generics)
-                    | ItemKind::Ty(_, ref generics)
+                    | ItemKind::TyAlias(_, ref generics)
                     | ItemKind::OpaqueTy(_, ref generics)
                     | ItemKind::Trait(_, _, ref generics, ..) => {
                         let def_id = self.lctx.resolver.definitions().local_def_id(item.id);
@@ -3440,7 +3440,7 @@ fn lower_item_kind(
             ItemKind::Mod(ref m) => hir::ItemKind::Mod(self.lower_mod(m)),
             ItemKind::ForeignMod(ref nm) => hir::ItemKind::ForeignMod(self.lower_foreign_mod(nm)),
             ItemKind::GlobalAsm(ref ga) => hir::ItemKind::GlobalAsm(self.lower_global_asm(ga)),
-            ItemKind::Ty(ref t, ref generics) => hir::ItemKind::Ty(
+            ItemKind::TyAlias(ref t, ref generics) => hir::ItemKind::TyAlias(
                 self.lower_ty(t, ImplTraitContext::disallowed()),
                 self.lower_generics(generics, ImplTraitContext::disallowed()),
             ),
index c44942a162685693ba03fc909065c959476f23a3..2ea34b22de7886a54eb30c65ef41625921cf50ba 100644 (file)
@@ -93,7 +93,7 @@ fn visit_item(&mut self, i: &'a Item) {
             ItemKind::Mod(..) | ItemKind::Trait(..) | ItemKind::TraitAlias(..) |
             ItemKind::Enum(..) | ItemKind::Struct(..) | ItemKind::Union(..) |
             ItemKind::OpaqueTy(..) | ItemKind::ExternCrate(..) | ItemKind::ForeignMod(..) |
-            ItemKind::Ty(..) => DefPathData::TypeNs(i.ident.as_interned_str()),
+            ItemKind::TyAlias(..) => DefPathData::TypeNs(i.ident.as_interned_str()),
             ItemKind::Fn(
                 ref decl,
                 ref header,
index b93961a1239160c10f00661caf06e20c7f2094e8..ca31d9f5996ab244abdcffe4b30d8cfed3383e71 100644 (file)
@@ -302,7 +302,7 @@ fn def_kind(&self, hir_id: HirId) -> Option<DefKind> {
                     ItemKind::Fn(..) => DefKind::Fn,
                     ItemKind::Mod(..) => DefKind::Mod,
                     ItemKind::OpaqueTy(..) => DefKind::OpaqueTy,
-                    ItemKind::Ty(..) => DefKind::TyAlias,
+                    ItemKind::TyAlias(..) => DefKind::TyAlias,
                     ItemKind::Enum(..) => DefKind::Enum,
                     ItemKind::Struct(..) => DefKind::Struct,
                     ItemKind::Union(..) => DefKind::Union,
@@ -576,7 +576,7 @@ pub fn get_generics(&self, id: DefId) -> Option<&'hir Generics> {
                 Node::Item(ref item) => {
                     match item.node {
                         ItemKind::Fn(_, _, ref generics, _) |
-                        ItemKind::Ty(_, ref generics) |
+                        ItemKind::TyAlias(_, ref generics) |
                         ItemKind::Enum(_, ref generics) |
                         ItemKind::Struct(_, ref generics) |
                         ItemKind::Union(_, ref generics) |
@@ -1269,7 +1269,7 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId, include_id: bool) -> String {
                 ItemKind::Mod(..) => "mod",
                 ItemKind::ForeignMod(..) => "foreign mod",
                 ItemKind::GlobalAsm(..) => "global asm",
-                ItemKind::Ty(..) => "ty",
+                ItemKind::TyAlias(..) => "ty",
                 ItemKind::OpaqueTy(..) => "opaque type",
                 ItemKind::Enum(..) => "enum",
                 ItemKind::Struct(..) => "struct",
index 5fe8069e3326ac567785facba811dc97aa58c130..14949d047fffe6eef56074d28ff7db4533d41fa5 100644 (file)
@@ -2420,7 +2420,7 @@ pub enum ItemKind {
     /// Module-level inline assembly (from global_asm!)
     GlobalAsm(P<GlobalAsm>),
     /// A type alias, e.g., `type Foo = Bar<u8>`
-    Ty(P<Ty>, Generics),
+    TyAlias(P<Ty>, Generics),
     /// An opaque `impl Trait` type alias, e.g., `type Foo = impl Bar;`
     OpaqueTy(OpaqueTy),
     /// An enum definition, e.g., `enum Foo<A, B> {C<A>, D<B>}`
@@ -2455,7 +2455,7 @@ pub fn descriptive_variant(&self) -> &str {
             ItemKind::Mod(..) => "module",
             ItemKind::ForeignMod(..) => "foreign module",
             ItemKind::GlobalAsm(..) => "global asm",
-            ItemKind::Ty(..) => "type alias",
+            ItemKind::TyAlias(..) => "type alias",
             ItemKind::OpaqueTy(..) => "opaque type",
             ItemKind::Enum(..) => "enum",
             ItemKind::Struct(..) => "struct",
@@ -2478,7 +2478,7 @@ pub fn adt_kind(&self) -> Option<AdtKind> {
     pub fn generics(&self) -> Option<&Generics> {
         Some(match *self {
             ItemKind::Fn(_, _, ref generics, _) |
-            ItemKind::Ty(_, ref generics) |
+            ItemKind::TyAlias(_, ref generics) |
             ItemKind::OpaqueTy(OpaqueTy { ref generics, impl_trait_fn: None, .. }) |
             ItemKind::Enum(_, ref generics) |
             ItemKind::Struct(_, ref generics) |
index a8760438fc02079d3d9639e456547ea16f095971..f9927014f622439209300035a5f72b291e0cfd04 100644 (file)
@@ -570,7 +570,7 @@ pub fn print_item(&mut self, item: &hir::Item) {
                 self.s.word(ga.asm.as_str().to_string());
                 self.end()
             }
-            hir::ItemKind::Ty(ref ty, ref generics) => {
+            hir::ItemKind::TyAlias(ref ty, ref generics) => {
                 self.print_item_type(item, &generics, |state| {
                     state.word_space("=");
                     state.print_type(&ty);
index fefb3dc076d79f45abfe7a8f9a400b7a0c7c8f9a..e8a0e22137e68b72e835b2008e8842d72da33324 100644 (file)
@@ -480,7 +480,7 @@ fn should_warn_about_item(&mut self, item: &hir::Item) -> bool {
             hir::ItemKind::Static(..)
             | hir::ItemKind::Const(..)
             | hir::ItemKind::Fn(..)
-            | hir::ItemKind::Ty(..)
+            | hir::ItemKind::TyAlias(..)
             | hir::ItemKind::Enum(..)
             | hir::ItemKind::Struct(..)
             | hir::ItemKind::Union(..) => true,
index 233cec2ef7d431729906bc1d2581fac0b208a672..7d40823c342234474461445e95f21de8ad953195 100644 (file)
@@ -264,7 +264,7 @@ fn propagate_node(&mut self, node: &Node<'tcx>,
                     hir::ItemKind::ExternCrate(_) |
                     hir::ItemKind::Use(..) |
                     hir::ItemKind::OpaqueTy(..) |
-                    hir::ItemKind::Ty(..) |
+                    hir::ItemKind::TyAlias(..) |
                     hir::ItemKind::Static(..) |
                     hir::ItemKind::Mod(..) |
                     hir::ItemKind::ForeignMod(..) |
index 80f85bec879d895b1d614554bf750ade77544b6b..f06bcfecf880a4ec3aaa4748cd70322c9d6a6b7c 100644 (file)
@@ -488,7 +488,7 @@ fn visit_item(&mut self, item: &'tcx hir::Item) {
                 // items. Doing anything on this node is irrelevant, as we currently don't need
                 // it.
             }
-            hir::ItemKind::Ty(_, ref generics)
+            hir::ItemKind::TyAlias(_, ref generics)
             | hir::ItemKind::OpaqueTy(hir::OpaqueTy {
                 impl_trait_fn: None,
                 ref generics,
@@ -1259,7 +1259,7 @@ fn compute_object_lifetime_defaults(tcx: TyCtxt<'_>) -> HirIdMap<Vec<ObjectLifet
                 impl_trait_fn: None,
                 ..
             })
-            | hir::ItemKind::Ty(_, ref generics)
+            | hir::ItemKind::TyAlias(_, ref generics)
             | hir::ItemKind::Trait(_, _, ref generics, ..) => {
                 let result = object_lifetime_defaults_for_item(tcx, generics);
 
index e621101324d3440160673d71a1a19780c3526dca..ecfc58794b9bdc80628ad77084959f4055b5d5db 100644 (file)
@@ -354,7 +354,7 @@ fn auto_labels(&mut self, item_id: hir::HirId, attr: &Attribute) -> (&'static st
                     HirItem::GlobalAsm(..) => ("ItemGlobalAsm", LABELS_HIR_ONLY),
 
                     // A type alias, e.g., `type Foo = Bar<u8>`
-                    HirItem::Ty(..) => ("ItemTy", LABELS_HIR_ONLY),
+                    HirItem::TyAlias(..) => ("ItemTy", LABELS_HIR_ONLY),
 
                     // An enum definition, e.g., `enum Foo<A, B> {C<A>, D<B>}`
                     HirItem::Enum(..) => ("ItemEnum", LABELS_ADT),
index 08a8d4007791379876a4186d9695b4e1f5ed20fc..76dc2f0db1625813f655dc3652f4652a1f87db69 100644 (file)
@@ -117,7 +117,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxPointers {
     fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) {
         match it.node {
             hir::ItemKind::Fn(..) |
-            hir::ItemKind::Ty(..) |
+            hir::ItemKind::TyAlias(..) |
             hir::ItemKind::Enum(..) |
             hir::ItemKind::Struct(..) |
             hir::ItemKind::Union(..) => {
@@ -406,7 +406,7 @@ fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) {
                 }
                 "a trait"
             }
-            hir::ItemKind::Ty(..) => "a type alias",
+            hir::ItemKind::TyAlias(..) => "a type alias",
             hir::ItemKind::Impl(.., Some(ref trait_ref), _, ref impl_item_refs) => {
                 // If the trait is private, add the impl items to `private_traits` so they don't get
                 // reported for missing docs.
@@ -1123,7 +1123,7 @@ fn visit_qpath(&mut self, qpath: &'v hir::QPath, id: hir::HirId, span: Span) {
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeAliasBounds {
     fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &hir::Item) {
         let (ty, type_alias_generics) = match item.node {
-            hir::ItemKind::Ty(ref ty, ref generics) => (&*ty, generics),
+            hir::ItemKind::TyAlias(ref ty, ref generics) => (&*ty, generics),
             _ => return,
         };
         let mut suggested_changing_assoc_types = false;
index 84f068ab50a22c5f792420c65b5a7195aca2861c..8f7fe6680cb14e80b4312ea30d1adbb650a6358b 100644 (file)
@@ -137,7 +137,7 @@ fn check_item(&mut self, cx: &EarlyContext<'_>, it: &ast::Item) {
         }
 
         match it.node {
-            ast::ItemKind::Ty(..) |
+            ast::ItemKind::TyAlias(..) |
             ast::ItemKind::Enum(..) |
             ast::ItemKind::Struct(..) |
             ast::ItemKind::Union(..) => self.check_case(cx, "type", &it.ident),
index 28252117dd2945af6e64f44b2fc473704b8ea998..e0b4e75010cbd58263d6c3217862b02fae59147c 100644 (file)
@@ -1094,7 +1094,7 @@ fn encode_info_for_item(&mut self, (def_id, item): (DefId, &'tcx hir::Item)) ->
             }
             hir::ItemKind::ForeignMod(_) => EntryKind::ForeignMod,
             hir::ItemKind::GlobalAsm(..) => EntryKind::GlobalAsm,
-            hir::ItemKind::Ty(..) => EntryKind::Type,
+            hir::ItemKind::TyAlias(..) => EntryKind::Type,
             hir::ItemKind::OpaqueTy(..) => EntryKind::OpaqueTy,
             hir::ItemKind::Enum(..) => EntryKind::Enum(get_repr_options(tcx, def_id)),
             hir::ItemKind::Struct(ref struct_def, _) => {
@@ -1227,7 +1227,7 @@ fn encode_info_for_item(&mut self, (def_id, item): (DefId, &'tcx hir::Item)) ->
                 hir::ItemKind::Static(..) |
                 hir::ItemKind::Const(..) |
                 hir::ItemKind::Fn(..) |
-                hir::ItemKind::Ty(..) |
+                hir::ItemKind::TyAlias(..) |
                 hir::ItemKind::OpaqueTy(..) |
                 hir::ItemKind::Enum(..) |
                 hir::ItemKind::Struct(..) |
@@ -1247,7 +1247,7 @@ fn encode_info_for_item(&mut self, (def_id, item): (DefId, &'tcx hir::Item)) ->
                 hir::ItemKind::Static(..) |
                 hir::ItemKind::Const(..) |
                 hir::ItemKind::Fn(..) |
-                hir::ItemKind::Ty(..) |
+                hir::ItemKind::TyAlias(..) |
                 hir::ItemKind::Enum(..) |
                 hir::ItemKind::Struct(..) |
                 hir::ItemKind::Union(..) |
@@ -1261,7 +1261,7 @@ fn encode_info_for_item(&mut self, (def_id, item): (DefId, &'tcx hir::Item)) ->
                 hir::ItemKind::Static(..) |
                 hir::ItemKind::Const(..) |
                 hir::ItemKind::Fn(..) |
-                hir::ItemKind::Ty(..) |
+                hir::ItemKind::TyAlias(..) |
                 hir::ItemKind::Enum(..) |
                 hir::ItemKind::Struct(..) |
                 hir::ItemKind::Union(..) |
@@ -1761,7 +1761,7 @@ fn encode_addl_info_for_item(&mut self, item: &hir::Item) {
             hir::ItemKind::GlobalAsm(..) |
             hir::ItemKind::ExternCrate(..) |
             hir::ItemKind::Use(..) |
-            hir::ItemKind::Ty(..) |
+            hir::ItemKind::TyAlias(..) |
             hir::ItemKind::OpaqueTy(..) |
             hir::ItemKind::TraitAlias(..) => {
                 // no sub-item recording needed in these cases
index b378dadce58a3d0ea846bd216157e6b82b55dc3f..12d763bb7910af96d5f694a604aeb314274eb3f5 100644 (file)
@@ -969,7 +969,7 @@ fn visit_item(&mut self, item: &'v hir::Item) {
             hir::ItemKind::ExternCrate(..) |
             hir::ItemKind::Use(..)         |
             hir::ItemKind::ForeignMod(..)  |
-            hir::ItemKind::Ty(..)          |
+            hir::ItemKind::TyAlias(..)          |
             hir::ItemKind::Trait(..)       |
             hir::ItemKind::TraitAlias(..)  |
             hir::ItemKind::OpaqueTy(..) |
index 95cb8de70675d12c604572560870fe51fb006c9f..45a185dccf29c7d829088494048a7130826d65f1 100644 (file)
@@ -31,7 +31,7 @@ impl ItemLikeVisitor<'tcx> for VarianceTest<'tcx> {
     fn visit_item(&mut self, item: &'tcx hir::Item) {
         let item_def_id = self.tcx.hir().local_def_id(item.hir_id);
 
-        if let ItemKind::Ty(..) = item.node {
+        if let ItemKind::TyAlias(..) = item.node {
             for attr in self.tcx.get_attrs(item_def_id).iter() {
                 if attr.check_name(sym::rustc_layout) {
                     self.dump_layout_of(item_def_id, item, attr);
index ac18f0e440b781d683d3659655e68c65b6647f18..8d6b7767f3ed9539be61558ad673819303f8784c 100644 (file)
@@ -534,7 +534,7 @@ fn visit_item(&mut self, item: &'tcx hir::Item) {
             hir::ItemKind::Static(..) | hir::ItemKind::Struct(..) |
             hir::ItemKind::Trait(..) | hir::ItemKind::TraitAlias(..) |
             hir::ItemKind::OpaqueTy(..) |
-            hir::ItemKind::Ty(..) | hir::ItemKind::Union(..) | hir::ItemKind::Use(..) => {
+            hir::ItemKind::TyAlias(..) | hir::ItemKind::Union(..) | hir::ItemKind::Use(..) => {
                 if item.vis.node.is_pub() { self.prev_level } else { None }
             }
         };
@@ -589,7 +589,7 @@ fn visit_item(&mut self, item: &'tcx hir::Item) {
             hir::ItemKind::Static(..) |
             hir::ItemKind::Const(..) |
             hir::ItemKind::GlobalAsm(..) |
-            hir::ItemKind::Ty(..) |
+            hir::ItemKind::TyAlias(..) |
             hir::ItemKind::Mod(..) |
             hir::ItemKind::TraitAlias(..) |
             hir::ItemKind::Fn(..) |
@@ -621,7 +621,7 @@ fn visit_item(&mut self, item: &'tcx hir::Item) {
             }
             // Visit everything.
             hir::ItemKind::Const(..) | hir::ItemKind::Static(..) |
-            hir::ItemKind::Fn(..) | hir::ItemKind::Ty(..) => {
+            hir::ItemKind::Fn(..) | hir::ItemKind::TyAlias(..) => {
                 if item_level.is_some() {
                     self.reach(item.hir_id, item_level).generics().predicates().ty();
                 }
@@ -1458,7 +1458,7 @@ fn visit_item(&mut self, item: &'tcx hir::Item) {
 
             // `type ... = ...;` can contain private types, because
             // we're introducing a new name.
-            hir::ItemKind::Ty(..) => return,
+            hir::ItemKind::TyAlias(..) => return,
 
             // Not at all public, so we don't care.
             _ if !self.item_is_public(&item.hir_id, &item.vis) => {
@@ -1739,7 +1739,7 @@ fn visit_item(&mut self, item: &'tcx hir::Item) {
             hir::ItemKind::GlobalAsm(..) => {}
             // Subitems of these items have inherited publicity.
             hir::ItemKind::Const(..) | hir::ItemKind::Static(..) |
-            hir::ItemKind::Fn(..) | hir::ItemKind::Ty(..) => {
+            hir::ItemKind::Fn(..) | hir::ItemKind::TyAlias(..) => {
                 self.check(item.hir_id, item_visibility).generics().predicates().ty();
             }
             hir::ItemKind::OpaqueTy(..) => {
index b66cc9e57f7f89029ace1b8e4d0ed63d2a5782bd..9d01f33002940170c00b40c927282aee4d604ee9 100644 (file)
@@ -459,7 +459,7 @@ fn build_reduced_graph_for_item(&mut self, item: &Item, parent_scope: ParentScop
             }
 
             // These items live in the type namespace.
-            ItemKind::Ty(..) => {
+            ItemKind::TyAlias(..) => {
                 let res = Res::Def(DefKind::TyAlias, self.definitions.local_def_id(item.id));
                 self.define(parent, ident, TypeNS, (res, vis, sp, expansion));
             }
index a49be7c27c94ac377a48e3efb2df6fe4c9dd0c40..dae39c16f71e073cb1cc5c2608afb18a023b8e29 100644 (file)
@@ -2709,7 +2709,7 @@ fn resolve_item(&mut self, item: &Item) {
         debug!("(resolving item) resolving {} ({:?})", name, item.node);
 
         match item.node {
-            ItemKind::Ty(_, ref generics) |
+            ItemKind::TyAlias(_, ref generics) |
             ItemKind::OpaqueTy(_, ref generics) |
             ItemKind::Fn(_, _, ref generics, _) => {
                 self.with_generic_param_rib(
index 3abec9307eea41047ad52bbdf8c32676e98a6ff4..1792c635bbefe6dc9a0a27f6b344ea0a1b9c6ce7 100644 (file)
@@ -1397,7 +1397,7 @@ fn visit_item(&mut self, item: &'l ast::Item) {
                 self.process_mod(item);
                 visit::walk_mod(self, m);
             }
-            Ty(ref ty, ref ty_params) => {
+            TyAlias(ref ty, ref ty_params) => {
                 let qualname = format!("::{}",
                     self.tcx.def_path_str(self.tcx.hir().local_def_id_from_node_id(item.id)));
                 let value = ty_to_string(&ty);
index cbfaf91cdfc998d4e7352cec4634371bfa7934a0..c212cda2d6679e4a5610307c8fe4750a0ddd4522 100644 (file)
@@ -438,7 +438,7 @@ fn make(&self, offset: usize, _parent_id: Option<NodeId>, scx: &SaveContext<'_,
                     refs: vec![],
                 })
             }
-            ast::ItemKind::Ty(ref ty, ref generics) => {
+            ast::ItemKind::TyAlias(ref ty, ref generics) => {
                 let text = "type ".to_owned();
                 let mut sig = name_and_generics(text, offset, generics, self.id, self.ident, scx)?;
 
index 8d6f9185962be8066e28087d6e0ca265d82bf337..194b81566c93df7817cc99760cda0ec95fd5d617 100644 (file)
@@ -1409,7 +1409,7 @@ pub fn check_item_type<'tcx>(tcx: TyCtxt<'tcx>, it: &'tcx hir::Item) {
             let substs = InternalSubsts::identity_for_item(tcx, def_id);
             check_opaque(tcx, def_id, substs, it.span, &origin);
         }
-        hir::ItemKind::Ty(..) => {
+        hir::ItemKind::TyAlias(..) => {
             let def_id = tcx.hir().local_def_id(it.hir_id);
             let pty_ty = tcx.type_of(def_id);
             let generics = tcx.generics_of(def_id);
index 15687eaa943e115da6456cb380731e1aa3925c5a..8c4b38d24cbe5dac133bdcd65fdcac4916f98a50 100644 (file)
@@ -293,7 +293,7 @@ fn type_param_predicates(
             match item.node {
                 ItemKind::Fn(.., ref generics, _)
                 | ItemKind::Impl(_, _, _, ref generics, ..)
-                | ItemKind::Ty(_, ref generics)
+                | ItemKind::TyAlias(_, ref generics)
                 | ItemKind::OpaqueTy(OpaqueTy {
                     ref generics,
                     impl_trait_fn: None,
@@ -462,7 +462,7 @@ fn convert_item(tcx: TyCtxt<'_>, item_id: hir::HirId) {
         }) => {}
 
         hir::ItemKind::OpaqueTy(..)
-        | hir::ItemKind::Ty(..)
+        | hir::ItemKind::TyAlias(..)
         | hir::ItemKind::Static(..)
         | hir::ItemKind::Const(..)
         | hir::ItemKind::Fn(..) => {
@@ -917,7 +917,7 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::Generics {
                     generics
                 }
 
-                ItemKind::Ty(_, ref generics)
+                ItemKind::TyAlias(_, ref generics)
                 | ItemKind::Enum(_, ref generics)
                 | ItemKind::Struct(_, ref generics)
                 | ItemKind::OpaqueTy(hir::OpaqueTy { ref generics, .. })
@@ -1242,7 +1242,7 @@ pub fn checked_type_of(tcx: TyCtxt<'_>, def_id: DefId, fail: bool) -> Option<Ty<
                         icx.to_ty(ty)
                     }
                 },
-                ItemKind::Ty(ref ty, _)
+                ItemKind::TyAlias(ref ty, _)
                 | ItemKind::Impl(.., ref ty, _) => icx.to_ty(ty),
                 ItemKind::Fn(..) => {
                     let substs = InternalSubsts::identity_for_item(tcx, def_id);
@@ -2038,7 +2038,7 @@ fn extend<I: IntoIterator<Item = (ty::Predicate<'tcx>, Span)>>(&mut self, iter:
                     generics
                 }
                 ItemKind::Fn(.., ref generics, _)
-                | ItemKind::Ty(_, ref generics)
+                | ItemKind::TyAlias(_, ref generics)
                 | ItemKind::Enum(_, ref generics)
                 | ItemKind::Struct(_, ref generics)
                 | ItemKind::Union(_, ref generics) => generics,
index a7fb18c3f2c951747da17fd52b49686a198d7579..ef9f5f2a957583add6b9d88ccf764f45086a06e0 100644 (file)
@@ -2802,7 +2802,7 @@ fn clean(&self, cx: &DocContext<'_>) -> Type {
                     }
                 };
 
-                if let Some(&hir::ItemKind::Ty(ref ty, ref generics)) = alias {
+                if let Some(&hir::ItemKind::TyAlias(ref ty, ref generics)) = alias {
                     let provided_params = &path.segments.last().expect("segments were empty");
                     let mut ty_substs = FxHashMap::default();
                     let mut lt_substs = FxHashMap::default();
index 098cecef95c8df8ee23dc26c33569d57ff18edd7..1ba2c0333d6bf6aa5ff62e8356d9a8789934996f 100644 (file)
@@ -458,7 +458,7 @@ pub fn visit_item(&mut self, item: &'tcx hir::Item,
                 om.unions.push(self.visit_union_data(item, ident.name, sd, gen)),
             hir::ItemKind::Fn(ref fd, header, ref gen, body) =>
                 self.visit_fn(om, item, ident.name, &**fd, header, gen, body),
-            hir::ItemKind::Ty(ref ty, ref gen) => {
+            hir::ItemKind::TyAlias(ref ty, ref gen) => {
                 let t = Typedef {
                     ty,
                     gen,
index 246c8f4b91f2d8034e6f274953b7796f870bd798..c8fb19f9eb5eadfb8982e9c55efe1d6f36592993 100644 (file)
@@ -2345,7 +2345,7 @@ pub enum ItemKind {
     /// A type alias (`type` or `pub type`).
     ///
     /// E.g., `type Foo = Bar<u8>;`.
-    Ty(P<Ty>, Generics),
+    TyAlias(P<Ty>, Generics),
     /// An opaque `impl Trait` type alias.
     ///
     /// E.g., `type Foo = impl Bar + Boo;`.
@@ -2402,7 +2402,7 @@ pub fn descriptive_variant(&self) -> &str {
             ItemKind::Mod(..) => "module",
             ItemKind::ForeignMod(..) => "foreign module",
             ItemKind::GlobalAsm(..) => "global asm",
-            ItemKind::Ty(..) => "type alias",
+            ItemKind::TyAlias(..) => "type alias",
             ItemKind::OpaqueTy(..) => "opaque type",
             ItemKind::Enum(..) => "enum",
             ItemKind::Struct(..) => "struct",
index b4b15ba31b713d78fd8e24f020a2a0addf5920ec..59e13fdc8f163a42d3dfd1c4391f363ad734e796 100644 (file)
@@ -858,7 +858,7 @@ pub fn item_const(&self,
 
     pub fn item_ty_poly(&self, span: Span, name: Ident, ty: P<ast::Ty>,
                     generics: Generics) -> P<ast::Item> {
-        self.item(span, name, Vec::new(), ast::ItemKind::Ty(ty, generics))
+        self.item(span, name, Vec::new(), ast::ItemKind::TyAlias(ty, generics))
     }
 
     pub fn item_ty(&self, span: Span, name: Ident, ty: P<ast::Ty>) -> P<ast::Item> {
index 176bcf1959a9d566ac11fc6ced27e6ea03edcff4..8fac2f30a5146a4a58123cffb1c5e32ebbfaa496 100644 (file)
@@ -847,7 +847,7 @@ pub fn noop_visit_item_kind<T: MutVisitor>(kind: &mut ItemKind, vis: &mut T) {
         ItemKind::Mod(m) => vis.visit_mod(m),
         ItemKind::ForeignMod(nm) => vis.visit_foreign_mod(nm),
         ItemKind::GlobalAsm(_ga) => {}
-        ItemKind::Ty(ty, generics) => {
+        ItemKind::TyAlias(ty, generics) => {
             vis.visit_ty(ty);
             vis.visit_generics(generics);
         }
index 880dd6e164982f4cb5dced000f4d92690c76d0f8..64acba9e40e1a4ec1106e3617ca9186765b8f534 100644 (file)
@@ -7243,7 +7243,7 @@ fn parse_item_implementation(
             let (ident, alias, generics) = type_?;
             // TYPE ITEM
             let item_ = match alias {
-                AliasKind::Weak(ty) => ItemKind::Ty(ty, generics),
+                AliasKind::Weak(ty) => ItemKind::TyAlias(ty, generics),
                 AliasKind::OpaqueTy(bounds) => ItemKind::OpaqueTy(bounds, generics),
             };
             let prev_span = self.prev_span;
index f3989be45ddc4e6940e34c2dcd09b24a9e141a69..a6c2dd1d925719423b415c027cd0db41ea583c80 100644 (file)
@@ -1208,7 +1208,7 @@ fn print_associated_type(&mut self,
                 self.s.word(ga.asm.as_str().to_string());
                 self.end();
             }
-            ast::ItemKind::Ty(ref ty, ref generics) => {
+            ast::ItemKind::TyAlias(ref ty, ref generics) => {
                 self.head(visibility_qualified(&item.vis, "type"));
                 self.print_ident(item.ident);
                 self.print_generic_params(&generics.params);
index 67226c2177fd6754f4e4ec5e2a2bdb512c671602..48dc54a4247542241aebc3ea0fe1310afc31d2ac 100644 (file)
@@ -255,7 +255,7 @@ pub fn walk_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a Item) {
             walk_list!(visitor, visit_foreign_item, &foreign_module.items);
         }
         ItemKind::GlobalAsm(ref ga) => visitor.visit_global_asm(ga),
-        ItemKind::Ty(ref typ, ref generics) => {
+        ItemKind::TyAlias(ref typ, ref generics) => {
             visitor.visit_ty(typ);
             visitor.visit_generics(generics)
         }