Rename ItemKind::Ty to ItemKind::TyAlias

This commit is contained in:
varkor 2019-08-02 11:02:08 +01:00
parent 460072ebee
commit 8aa45c65d8
31 changed files with 52 additions and 52 deletions

View file

@ -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,

View 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)

View file

@ -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()),
),

View file

@ -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,

View file

@ -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",

View 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 @@ 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) |

View file

@ -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);

View file

@ -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,

View file

@ -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(..) |

View file

@ -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<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);