diff --git a/src/librustc/hir/check_attr.rs b/src/librustc/hir/check_attr.rs index db90e44b892..b6cd173fbd1 100644 --- a/src/librustc/hir/check_attr.rs +++ b/src/librustc/hir/check_attr.rs @@ -75,7 +75,7 @@ impl 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, diff --git a/src/librustc/hir/intravisit.rs b/src/librustc/hir/intravisit.rs index 625e746c24f..1e569009edb 100644 --- a/src/librustc/hir/intravisit.rs +++ b/src/librustc/hir/intravisit.rs @@ -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) diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index f76de96cd10..8a549518f04 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -486,7 +486,7 @@ impl<'a> LoweringContext<'a> { 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 @@ impl<'a> LoweringContext<'a> { 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()), ), diff --git a/src/librustc/hir/map/def_collector.rs b/src/librustc/hir/map/def_collector.rs index c44942a1626..2ea34b22de7 100644 --- a/src/librustc/hir/map/def_collector.rs +++ b/src/librustc/hir/map/def_collector.rs @@ -93,7 +93,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> { 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, diff --git a/src/librustc/hir/map/mod.rs b/src/librustc/hir/map/mod.rs index b93961a1239..ca31d9f5996 100644 --- a/src/librustc/hir/map/mod.rs +++ b/src/librustc/hir/map/mod.rs @@ -302,7 +302,7 @@ impl<'hir> Map<'hir> { 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 @@ impl<'hir> Map<'hir> { 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", diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index 5fe8069e332..14949d047ff 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -2420,7 +2420,7 @@ pub enum ItemKind { /// Module-level inline assembly (from global_asm!) GlobalAsm(P), /// A type alias, e.g., `type Foo = Bar` - Ty(P, Generics), + TyAlias(P, Generics), /// An opaque `impl Trait` type alias, e.g., `type Foo = impl Bar;` OpaqueTy(OpaqueTy), /// An enum definition, e.g., `enum Foo {C, D}` @@ -2455,7 +2455,7 @@ impl ItemKind { 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 @@ impl ItemKind { 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) | diff --git a/src/librustc/hir/print.rs b/src/librustc/hir/print.rs index a8760438fc0..f9927014f62 100644 --- a/src/librustc/hir/print.rs +++ b/src/librustc/hir/print.rs @@ -570,7 +570,7 @@ impl<'a> State<'a> { 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); diff --git a/src/librustc/middle/dead.rs b/src/librustc/middle/dead.rs index fefb3dc076d..e8a0e22137e 100644 --- a/src/librustc/middle/dead.rs +++ b/src/librustc/middle/dead.rs @@ -480,7 +480,7 @@ impl DeadVisitor<'tcx> { 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, diff --git a/src/librustc/middle/reachable.rs b/src/librustc/middle/reachable.rs index 233cec2ef7d..7d40823c342 100644 --- a/src/librustc/middle/reachable.rs +++ b/src/librustc/middle/reachable.rs @@ -264,7 +264,7 @@ impl<'a, 'tcx> ReachableContext<'a, '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(..) | diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index 80f85bec879..f06bcfecf88 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -488,7 +488,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> { // 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 { let result = object_lifetime_defaults_for_item(tcx, generics); diff --git a/src/librustc_incremental/persist/dirty_clean.rs b/src/librustc_incremental/persist/dirty_clean.rs index e621101324d..ecfc58794b9 100644 --- a/src/librustc_incremental/persist/dirty_clean.rs +++ b/src/librustc_incremental/persist/dirty_clean.rs @@ -354,7 +354,7 @@ impl DirtyCleanVisitor<'tcx> { HirItem::GlobalAsm(..) => ("ItemGlobalAsm", LABELS_HIR_ONLY), // A type alias, e.g., `type Foo = Bar` - HirItem::Ty(..) => ("ItemTy", LABELS_HIR_ONLY), + HirItem::TyAlias(..) => ("ItemTy", LABELS_HIR_ONLY), // An enum definition, e.g., `enum Foo {C, D}` HirItem::Enum(..) => ("ItemEnum", LABELS_ADT), diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 08a8d400779..76dc2f0db16 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -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 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc { } "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 @@ impl TypeAliasBounds { 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; diff --git a/src/librustc_lint/nonstandard_style.rs b/src/librustc_lint/nonstandard_style.rs index 84f068ab50a..8f7fe6680cb 100644 --- a/src/librustc_lint/nonstandard_style.rs +++ b/src/librustc_lint/nonstandard_style.rs @@ -137,7 +137,7 @@ impl EarlyLintPass for NonCamelCaseTypes { } 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), diff --git a/src/librustc_metadata/encoder.rs b/src/librustc_metadata/encoder.rs index 28252117dd2..e0b4e75010c 100644 --- a/src/librustc_metadata/encoder.rs +++ b/src/librustc_metadata/encoder.rs @@ -1094,7 +1094,7 @@ impl EncodeContext<'tcx> { } 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 @@ impl EncodeContext<'tcx> { 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 @@ impl EncodeContext<'tcx> { 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 @@ impl EncodeContext<'tcx> { 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 @@ impl EncodeContext<'tcx> { 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 diff --git a/src/librustc_mir/monomorphize/collector.rs b/src/librustc_mir/monomorphize/collector.rs index b378dadce58..12d763bb791 100644 --- a/src/librustc_mir/monomorphize/collector.rs +++ b/src/librustc_mir/monomorphize/collector.rs @@ -969,7 +969,7 @@ impl ItemLikeVisitor<'v> for RootCollector<'_, 'v> { hir::ItemKind::ExternCrate(..) | hir::ItemKind::Use(..) | hir::ItemKind::ForeignMod(..) | - hir::ItemKind::Ty(..) | + hir::ItemKind::TyAlias(..) | hir::ItemKind::Trait(..) | hir::ItemKind::TraitAlias(..) | hir::ItemKind::OpaqueTy(..) | diff --git a/src/librustc_passes/layout_test.rs b/src/librustc_passes/layout_test.rs index 95cb8de7067..45a185dccf2 100644 --- a/src/librustc_passes/layout_test.rs +++ b/src/librustc_passes/layout_test.rs @@ -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); diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index ac18f0e440b..8d6b7767f3e 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -534,7 +534,7 @@ impl Visitor<'tcx> for EmbargoVisitor<'tcx> { 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 @@ impl Visitor<'tcx> for EmbargoVisitor<'tcx> { 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 @@ impl Visitor<'tcx> for EmbargoVisitor<'tcx> { } // 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 @@ impl<'a, 'tcx> Visitor<'tcx> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> { // `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 @@ impl<'a, 'tcx> Visitor<'tcx> for PrivateItemsInPublicInterfacesVisitor<'a, 'tcx> 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(..) => { diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index b66cc9e57f7..9d01f330029 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -459,7 +459,7 @@ impl<'a> Resolver<'a> { } // 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)); } diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index a49be7c27c9..dae39c16f71 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -2709,7 +2709,7 @@ impl<'a> Resolver<'a> { 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( diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs index 3abec9307ee..1792c635bbe 100644 --- a/src/librustc_save_analysis/dump_visitor.rs +++ b/src/librustc_save_analysis/dump_visitor.rs @@ -1397,7 +1397,7 @@ impl<'l, 'tcx> Visitor<'l> for DumpVisitor<'l, 'tcx> { 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); diff --git a/src/librustc_save_analysis/sig.rs b/src/librustc_save_analysis/sig.rs index cbfaf91cdfc..c212cda2d66 100644 --- a/src/librustc_save_analysis/sig.rs +++ b/src/librustc_save_analysis/sig.rs @@ -438,7 +438,7 @@ impl Sig for ast::Item { 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)?; diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 8d6f9185962..194b81566c9 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -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); diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 15687eaa943..8c4b38d24cb 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -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 icx.to_ty(ty), ItemKind::Fn(..) => { let substs = InternalSubsts::identity_for_item(tcx, def_id); @@ -2038,7 +2038,7 @@ fn explicit_predicates_of( 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, diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index a7fb18c3f2c..ef9f5f2a957 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -2802,7 +2802,7 @@ impl Clean for hir::Ty { } }; - 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(); diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index 098cecef95c..1ba2c0333d6 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -458,7 +458,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { 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, diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 246c8f4b91f..c8fb19f9eb5 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -2345,7 +2345,7 @@ pub enum ItemKind { /// A type alias (`type` or `pub type`). /// /// E.g., `type Foo = Bar;`. - Ty(P, Generics), + TyAlias(P, Generics), /// An opaque `impl Trait` type alias. /// /// E.g., `type Foo = impl Bar + Boo;`. @@ -2402,7 +2402,7 @@ impl ItemKind { 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", diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index b4b15ba31b7..59e13fdc8f1 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -858,7 +858,7 @@ impl<'a> ExtCtxt<'a> { pub fn item_ty_poly(&self, span: Span, name: Ident, ty: P, generics: Generics) -> P { - 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) -> P { diff --git a/src/libsyntax/mut_visit.rs b/src/libsyntax/mut_visit.rs index 176bcf1959a..8fac2f30a51 100644 --- a/src/libsyntax/mut_visit.rs +++ b/src/libsyntax/mut_visit.rs @@ -847,7 +847,7 @@ pub fn noop_visit_item_kind(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); } diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 880dd6e1649..64acba9e40e 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -7243,7 +7243,7 @@ impl<'a> Parser<'a> { 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; diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index f3989be45dd..a6c2dd1d925 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1208,7 +1208,7 @@ impl<'a> State<'a> { 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); diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 67226c2177f..48dc54a4247 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -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) }