Auto merge of #63213 - varkor:itemkind-tyalias, r=Centril
Rename `ItemKind::Ty` to `ItemKind::TyAlias` The current name is not entirely clear without context and `TyAlias` is consistent with `ItemKind::TraitAlias`.
This commit is contained in:
commit
d3f8a0b5df
36 changed files with 90 additions and 89 deletions
|
@ -26,7 +26,7 @@ pub(crate) enum Target {
|
||||||
Mod,
|
Mod,
|
||||||
ForeignMod,
|
ForeignMod,
|
||||||
GlobalAsm,
|
GlobalAsm,
|
||||||
Ty,
|
TyAlias,
|
||||||
OpaqueTy,
|
OpaqueTy,
|
||||||
Enum,
|
Enum,
|
||||||
Struct,
|
Struct,
|
||||||
|
@ -50,7 +50,7 @@ impl Display for Target {
|
||||||
Target::Mod => "module",
|
Target::Mod => "module",
|
||||||
Target::ForeignMod => "foreign module",
|
Target::ForeignMod => "foreign module",
|
||||||
Target::GlobalAsm => "global asm",
|
Target::GlobalAsm => "global asm",
|
||||||
Target::Ty => "type alias",
|
Target::TyAlias => "type alias",
|
||||||
Target::OpaqueTy => "opaque type",
|
Target::OpaqueTy => "opaque type",
|
||||||
Target::Enum => "enum",
|
Target::Enum => "enum",
|
||||||
Target::Struct => "struct",
|
Target::Struct => "struct",
|
||||||
|
@ -75,7 +75,7 @@ impl Target {
|
||||||
hir::ItemKind::Mod(..) => Target::Mod,
|
hir::ItemKind::Mod(..) => Target::Mod,
|
||||||
hir::ItemKind::ForeignMod(..) => Target::ForeignMod,
|
hir::ItemKind::ForeignMod(..) => Target::ForeignMod,
|
||||||
hir::ItemKind::GlobalAsm(..) => Target::GlobalAsm,
|
hir::ItemKind::GlobalAsm(..) => Target::GlobalAsm,
|
||||||
hir::ItemKind::Ty(..) => Target::Ty,
|
hir::ItemKind::TyAlias(..) => Target::TyAlias,
|
||||||
hir::ItemKind::OpaqueTy(..) => Target::OpaqueTy,
|
hir::ItemKind::OpaqueTy(..) => Target::OpaqueTy,
|
||||||
hir::ItemKind::Enum(..) => Target::Enum,
|
hir::ItemKind::Enum(..) => Target::Enum,
|
||||||
hir::ItemKind::Struct(..) => Target::Struct,
|
hir::ItemKind::Struct(..) => Target::Struct,
|
||||||
|
|
|
@ -500,7 +500,7 @@ pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item) {
|
||||||
ItemKind::GlobalAsm(_) => {
|
ItemKind::GlobalAsm(_) => {
|
||||||
visitor.visit_id(item.hir_id);
|
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_id(item.hir_id);
|
||||||
visitor.visit_ty(ty);
|
visitor.visit_ty(ty);
|
||||||
visitor.visit_generics(generics)
|
visitor.visit_generics(generics)
|
||||||
|
@ -926,7 +926,7 @@ pub fn walk_impl_item<'v, V: Visitor<'v>>(visitor: &mut V, impl_item: &'v ImplIt
|
||||||
impl_item.span,
|
impl_item.span,
|
||||||
impl_item.hir_id);
|
impl_item.hir_id);
|
||||||
}
|
}
|
||||||
ImplItemKind::Type(ref ty) => {
|
ImplItemKind::TyAlias(ref ty) => {
|
||||||
visitor.visit_id(impl_item.hir_id);
|
visitor.visit_id(impl_item.hir_id);
|
||||||
visitor.visit_ty(ty);
|
visitor.visit_ty(ty);
|
||||||
}
|
}
|
||||||
|
|
|
@ -486,7 +486,7 @@ impl<'a> LoweringContext<'a> {
|
||||||
ItemKind::Struct(_, ref generics)
|
ItemKind::Struct(_, ref generics)
|
||||||
| ItemKind::Union(_, ref generics)
|
| ItemKind::Union(_, ref generics)
|
||||||
| ItemKind::Enum(_, ref generics)
|
| ItemKind::Enum(_, ref generics)
|
||||||
| ItemKind::Ty(_, ref generics)
|
| ItemKind::TyAlias(_, ref generics)
|
||||||
| ItemKind::OpaqueTy(_, ref generics)
|
| ItemKind::OpaqueTy(_, ref generics)
|
||||||
| ItemKind::Trait(_, _, ref generics, ..) => {
|
| ItemKind::Trait(_, _, ref generics, ..) => {
|
||||||
let def_id = self.lctx.resolver.definitions().local_def_id(item.id);
|
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::Mod(ref m) => hir::ItemKind::Mod(self.lower_mod(m)),
|
||||||
ItemKind::ForeignMod(ref nm) => hir::ItemKind::ForeignMod(self.lower_foreign_mod(nm)),
|
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::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_ty(t, ImplTraitContext::disallowed()),
|
||||||
self.lower_generics(generics, ImplTraitContext::disallowed()),
|
self.lower_generics(generics, ImplTraitContext::disallowed()),
|
||||||
),
|
),
|
||||||
|
@ -3914,9 +3914,9 @@ impl<'a> LoweringContext<'a> {
|
||||||
|
|
||||||
(generics, hir::ImplItemKind::Method(sig, body_id))
|
(generics, hir::ImplItemKind::Method(sig, body_id))
|
||||||
}
|
}
|
||||||
ImplItemKind::Type(ref ty) => (
|
ImplItemKind::TyAlias(ref ty) => (
|
||||||
self.lower_generics(&i.generics, ImplTraitContext::disallowed()),
|
self.lower_generics(&i.generics, ImplTraitContext::disallowed()),
|
||||||
hir::ImplItemKind::Type(self.lower_ty(ty, ImplTraitContext::disallowed())),
|
hir::ImplItemKind::TyAlias(self.lower_ty(ty, ImplTraitContext::disallowed())),
|
||||||
),
|
),
|
||||||
ImplItemKind::OpaqueTy(ref bounds) => (
|
ImplItemKind::OpaqueTy(ref bounds) => (
|
||||||
self.lower_generics(&i.generics, ImplTraitContext::disallowed()),
|
self.lower_generics(&i.generics, ImplTraitContext::disallowed()),
|
||||||
|
@ -3950,7 +3950,7 @@ impl<'a> LoweringContext<'a> {
|
||||||
defaultness: self.lower_defaultness(i.defaultness, true /* [1] */),
|
defaultness: self.lower_defaultness(i.defaultness, true /* [1] */),
|
||||||
kind: match i.node {
|
kind: match i.node {
|
||||||
ImplItemKind::Const(..) => hir::AssocItemKind::Const,
|
ImplItemKind::Const(..) => hir::AssocItemKind::Const,
|
||||||
ImplItemKind::Type(..) => hir::AssocItemKind::Type,
|
ImplItemKind::TyAlias(..) => hir::AssocItemKind::Type,
|
||||||
ImplItemKind::OpaqueTy(..) => hir::AssocItemKind::OpaqueTy,
|
ImplItemKind::OpaqueTy(..) => hir::AssocItemKind::OpaqueTy,
|
||||||
ImplItemKind::Method(ref sig, _) => hir::AssocItemKind::Method {
|
ImplItemKind::Method(ref sig, _) => hir::AssocItemKind::Method {
|
||||||
has_self: sig.decl.has_self(),
|
has_self: sig.decl.has_self(),
|
||||||
|
|
|
@ -93,7 +93,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
|
||||||
ItemKind::Mod(..) | ItemKind::Trait(..) | ItemKind::TraitAlias(..) |
|
ItemKind::Mod(..) | ItemKind::Trait(..) | ItemKind::TraitAlias(..) |
|
||||||
ItemKind::Enum(..) | ItemKind::Struct(..) | ItemKind::Union(..) |
|
ItemKind::Enum(..) | ItemKind::Struct(..) | ItemKind::Union(..) |
|
||||||
ItemKind::OpaqueTy(..) | ItemKind::ExternCrate(..) | ItemKind::ForeignMod(..) |
|
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(
|
ItemKind::Fn(
|
||||||
ref decl,
|
ref decl,
|
||||||
ref header,
|
ref header,
|
||||||
|
@ -222,7 +222,7 @@ impl<'a> visit::Visitor<'a> for DefCollector<'a> {
|
||||||
}
|
}
|
||||||
ImplItemKind::Method(..) | ImplItemKind::Const(..) =>
|
ImplItemKind::Method(..) | ImplItemKind::Const(..) =>
|
||||||
DefPathData::ValueNs(ii.ident.as_interned_str()),
|
DefPathData::ValueNs(ii.ident.as_interned_str()),
|
||||||
ImplItemKind::Type(..) |
|
ImplItemKind::TyAlias(..) |
|
||||||
ImplItemKind::OpaqueTy(..) => {
|
ImplItemKind::OpaqueTy(..) => {
|
||||||
DefPathData::TypeNs(ii.ident.as_interned_str())
|
DefPathData::TypeNs(ii.ident.as_interned_str())
|
||||||
},
|
},
|
||||||
|
|
|
@ -302,7 +302,7 @@ impl<'hir> Map<'hir> {
|
||||||
ItemKind::Fn(..) => DefKind::Fn,
|
ItemKind::Fn(..) => DefKind::Fn,
|
||||||
ItemKind::Mod(..) => DefKind::Mod,
|
ItemKind::Mod(..) => DefKind::Mod,
|
||||||
ItemKind::OpaqueTy(..) => DefKind::OpaqueTy,
|
ItemKind::OpaqueTy(..) => DefKind::OpaqueTy,
|
||||||
ItemKind::Ty(..) => DefKind::TyAlias,
|
ItemKind::TyAlias(..) => DefKind::TyAlias,
|
||||||
ItemKind::Enum(..) => DefKind::Enum,
|
ItemKind::Enum(..) => DefKind::Enum,
|
||||||
ItemKind::Struct(..) => DefKind::Struct,
|
ItemKind::Struct(..) => DefKind::Struct,
|
||||||
ItemKind::Union(..) => DefKind::Union,
|
ItemKind::Union(..) => DefKind::Union,
|
||||||
|
@ -333,7 +333,7 @@ impl<'hir> Map<'hir> {
|
||||||
match item.node {
|
match item.node {
|
||||||
ImplItemKind::Const(..) => DefKind::AssocConst,
|
ImplItemKind::Const(..) => DefKind::AssocConst,
|
||||||
ImplItemKind::Method(..) => DefKind::Method,
|
ImplItemKind::Method(..) => DefKind::Method,
|
||||||
ImplItemKind::Type(..) => DefKind::AssocTy,
|
ImplItemKind::TyAlias(..) => DefKind::AssocTy,
|
||||||
ImplItemKind::OpaqueTy(..) => DefKind::AssocOpaqueTy,
|
ImplItemKind::OpaqueTy(..) => DefKind::AssocOpaqueTy,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -576,7 +576,7 @@ impl<'hir> Map<'hir> {
|
||||||
Node::Item(ref item) => {
|
Node::Item(ref item) => {
|
||||||
match item.node {
|
match item.node {
|
||||||
ItemKind::Fn(_, _, ref generics, _) |
|
ItemKind::Fn(_, _, ref generics, _) |
|
||||||
ItemKind::Ty(_, ref generics) |
|
ItemKind::TyAlias(_, ref generics) |
|
||||||
ItemKind::Enum(_, ref generics) |
|
ItemKind::Enum(_, ref generics) |
|
||||||
ItemKind::Struct(_, ref generics) |
|
ItemKind::Struct(_, ref generics) |
|
||||||
ItemKind::Union(_, 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::Mod(..) => "mod",
|
||||||
ItemKind::ForeignMod(..) => "foreign mod",
|
ItemKind::ForeignMod(..) => "foreign mod",
|
||||||
ItemKind::GlobalAsm(..) => "global asm",
|
ItemKind::GlobalAsm(..) => "global asm",
|
||||||
ItemKind::Ty(..) => "ty",
|
ItemKind::TyAlias(..) => "ty",
|
||||||
ItemKind::OpaqueTy(..) => "opaque type",
|
ItemKind::OpaqueTy(..) => "opaque type",
|
||||||
ItemKind::Enum(..) => "enum",
|
ItemKind::Enum(..) => "enum",
|
||||||
ItemKind::Struct(..) => "struct",
|
ItemKind::Struct(..) => "struct",
|
||||||
|
@ -1291,7 +1291,7 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId, include_id: bool) -> String {
|
||||||
ImplItemKind::Method(..) => {
|
ImplItemKind::Method(..) => {
|
||||||
format!("method {} in {}{}", ii.ident, path_str(), id_str)
|
format!("method {} in {}{}", ii.ident, path_str(), id_str)
|
||||||
}
|
}
|
||||||
ImplItemKind::Type(_) => {
|
ImplItemKind::TyAlias(_) => {
|
||||||
format!("assoc type {} in {}{}", ii.ident, path_str(), id_str)
|
format!("assoc type {} in {}{}", ii.ident, path_str(), id_str)
|
||||||
}
|
}
|
||||||
ImplItemKind::OpaqueTy(_) => {
|
ImplItemKind::OpaqueTy(_) => {
|
||||||
|
|
|
@ -1837,7 +1837,7 @@ pub enum ImplItemKind {
|
||||||
/// A method implementation with the given signature and body.
|
/// A method implementation with the given signature and body.
|
||||||
Method(MethodSig, BodyId),
|
Method(MethodSig, BodyId),
|
||||||
/// An associated type.
|
/// An associated type.
|
||||||
Type(P<Ty>),
|
TyAlias(P<Ty>),
|
||||||
/// An associated `type = impl Trait`.
|
/// An associated `type = impl Trait`.
|
||||||
OpaqueTy(GenericBounds),
|
OpaqueTy(GenericBounds),
|
||||||
}
|
}
|
||||||
|
@ -2420,7 +2420,7 @@ pub enum ItemKind {
|
||||||
/// Module-level inline assembly (from global_asm!)
|
/// Module-level inline assembly (from global_asm!)
|
||||||
GlobalAsm(P<GlobalAsm>),
|
GlobalAsm(P<GlobalAsm>),
|
||||||
/// A type alias, e.g., `type Foo = Bar<u8>`
|
/// 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;`
|
/// An opaque `impl Trait` type alias, e.g., `type Foo = impl Bar;`
|
||||||
OpaqueTy(OpaqueTy),
|
OpaqueTy(OpaqueTy),
|
||||||
/// An enum definition, e.g., `enum Foo<A, B> {C<A>, D<B>}`
|
/// An enum definition, e.g., `enum Foo<A, B> {C<A>, D<B>}`
|
||||||
|
@ -2455,7 +2455,7 @@ impl ItemKind {
|
||||||
ItemKind::Mod(..) => "module",
|
ItemKind::Mod(..) => "module",
|
||||||
ItemKind::ForeignMod(..) => "foreign module",
|
ItemKind::ForeignMod(..) => "foreign module",
|
||||||
ItemKind::GlobalAsm(..) => "global asm",
|
ItemKind::GlobalAsm(..) => "global asm",
|
||||||
ItemKind::Ty(..) => "type alias",
|
ItemKind::TyAlias(..) => "type alias",
|
||||||
ItemKind::OpaqueTy(..) => "opaque type",
|
ItemKind::OpaqueTy(..) => "opaque type",
|
||||||
ItemKind::Enum(..) => "enum",
|
ItemKind::Enum(..) => "enum",
|
||||||
ItemKind::Struct(..) => "struct",
|
ItemKind::Struct(..) => "struct",
|
||||||
|
@ -2478,7 +2478,7 @@ impl ItemKind {
|
||||||
pub fn generics(&self) -> Option<&Generics> {
|
pub fn generics(&self) -> Option<&Generics> {
|
||||||
Some(match *self {
|
Some(match *self {
|
||||||
ItemKind::Fn(_, _, ref generics, _) |
|
ItemKind::Fn(_, _, ref generics, _) |
|
||||||
ItemKind::Ty(_, ref generics) |
|
ItemKind::TyAlias(_, ref generics) |
|
||||||
ItemKind::OpaqueTy(OpaqueTy { ref generics, impl_trait_fn: None, .. }) |
|
ItemKind::OpaqueTy(OpaqueTy { ref generics, impl_trait_fn: None, .. }) |
|
||||||
ItemKind::Enum(_, ref generics) |
|
ItemKind::Enum(_, ref generics) |
|
||||||
ItemKind::Struct(_, ref generics) |
|
ItemKind::Struct(_, ref generics) |
|
||||||
|
|
|
@ -570,7 +570,7 @@ impl<'a> State<'a> {
|
||||||
self.s.word(ga.asm.as_str().to_string());
|
self.s.word(ga.asm.as_str().to_string());
|
||||||
self.end()
|
self.end()
|
||||||
}
|
}
|
||||||
hir::ItemKind::Ty(ref ty, ref generics) => {
|
hir::ItemKind::TyAlias(ref ty, ref generics) => {
|
||||||
self.print_item_type(item, &generics, |state| {
|
self.print_item_type(item, &generics, |state| {
|
||||||
state.word_space("=");
|
state.word_space("=");
|
||||||
state.print_type(&ty);
|
state.print_type(&ty);
|
||||||
|
@ -908,7 +908,7 @@ impl<'a> State<'a> {
|
||||||
self.end(); // need to close a box
|
self.end(); // need to close a box
|
||||||
self.ann.nested(self, Nested::Body(body));
|
self.ann.nested(self, Nested::Body(body));
|
||||||
}
|
}
|
||||||
hir::ImplItemKind::Type(ref ty) => {
|
hir::ImplItemKind::TyAlias(ref ty) => {
|
||||||
self.print_associated_type(ii.ident, None, Some(ty));
|
self.print_associated_type(ii.ident, None, Some(ty));
|
||||||
}
|
}
|
||||||
hir::ImplItemKind::OpaqueTy(ref bounds) => {
|
hir::ImplItemKind::OpaqueTy(ref bounds) => {
|
||||||
|
|
|
@ -270,7 +270,7 @@ impl<'tcx> TyCtxt<'tcx> {
|
||||||
hir::ImplItemKind::Method(..) => "method body",
|
hir::ImplItemKind::Method(..) => "method body",
|
||||||
hir::ImplItemKind::Const(..)
|
hir::ImplItemKind::Const(..)
|
||||||
| hir::ImplItemKind::OpaqueTy(..)
|
| hir::ImplItemKind::OpaqueTy(..)
|
||||||
| hir::ImplItemKind::Type(..) => "associated item",
|
| hir::ImplItemKind::TyAlias(..) => "associated item",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -480,7 +480,7 @@ impl DeadVisitor<'tcx> {
|
||||||
hir::ItemKind::Static(..)
|
hir::ItemKind::Static(..)
|
||||||
| hir::ItemKind::Const(..)
|
| hir::ItemKind::Const(..)
|
||||||
| hir::ItemKind::Fn(..)
|
| hir::ItemKind::Fn(..)
|
||||||
| hir::ItemKind::Ty(..)
|
| hir::ItemKind::TyAlias(..)
|
||||||
| hir::ItemKind::Enum(..)
|
| hir::ItemKind::Enum(..)
|
||||||
| hir::ItemKind::Struct(..)
|
| hir::ItemKind::Struct(..)
|
||||||
| hir::ItemKind::Union(..) => true,
|
| hir::ItemKind::Union(..) => true,
|
||||||
|
@ -640,7 +640,7 @@ impl Visitor<'tcx> for DeadVisitor<'tcx> {
|
||||||
self.visit_nested_body(body_id)
|
self.visit_nested_body(body_id)
|
||||||
}
|
}
|
||||||
hir::ImplItemKind::OpaqueTy(..) |
|
hir::ImplItemKind::OpaqueTy(..) |
|
||||||
hir::ImplItemKind::Type(..) => {}
|
hir::ImplItemKind::TyAlias(..) => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -189,7 +189,7 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hir::ImplItemKind::OpaqueTy(..) |
|
hir::ImplItemKind::OpaqueTy(..) |
|
||||||
hir::ImplItemKind::Type(_) => false,
|
hir::ImplItemKind::TyAlias(_) => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some(_) => false,
|
Some(_) => false,
|
||||||
|
@ -264,7 +264,7 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
|
||||||
hir::ItemKind::ExternCrate(_) |
|
hir::ItemKind::ExternCrate(_) |
|
||||||
hir::ItemKind::Use(..) |
|
hir::ItemKind::Use(..) |
|
||||||
hir::ItemKind::OpaqueTy(..) |
|
hir::ItemKind::OpaqueTy(..) |
|
||||||
hir::ItemKind::Ty(..) |
|
hir::ItemKind::TyAlias(..) |
|
||||||
hir::ItemKind::Static(..) |
|
hir::ItemKind::Static(..) |
|
||||||
hir::ItemKind::Mod(..) |
|
hir::ItemKind::Mod(..) |
|
||||||
hir::ItemKind::ForeignMod(..) |
|
hir::ItemKind::ForeignMod(..) |
|
||||||
|
@ -302,7 +302,7 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hir::ImplItemKind::OpaqueTy(..) |
|
hir::ImplItemKind::OpaqueTy(..) |
|
||||||
hir::ImplItemKind::Type(_) => {}
|
hir::ImplItemKind::TyAlias(_) => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Node::Expr(&hir::Expr { node: hir::ExprKind::Closure(.., body, _, _), .. }) => {
|
Node::Expr(&hir::Expr { node: hir::ExprKind::Closure(.., body, _, _), .. }) => {
|
||||||
|
|
|
@ -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
|
// items. Doing anything on this node is irrelevant, as we currently don't need
|
||||||
// it.
|
// it.
|
||||||
}
|
}
|
||||||
hir::ItemKind::Ty(_, ref generics)
|
hir::ItemKind::TyAlias(_, ref generics)
|
||||||
| hir::ItemKind::OpaqueTy(hir::OpaqueTy {
|
| hir::ItemKind::OpaqueTy(hir::OpaqueTy {
|
||||||
impl_trait_fn: None,
|
impl_trait_fn: None,
|
||||||
ref generics,
|
ref generics,
|
||||||
|
@ -828,7 +828,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
|
||||||
|this| intravisit::walk_impl_item(this, impl_item),
|
|this| intravisit::walk_impl_item(this, impl_item),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Type(ref ty) => {
|
TyAlias(ref ty) => {
|
||||||
let generics = &impl_item.generics;
|
let generics = &impl_item.generics;
|
||||||
let mut index = self.next_early_index();
|
let mut index = self.next_early_index();
|
||||||
let mut non_lifetime_count = 0;
|
let mut non_lifetime_count = 0;
|
||||||
|
@ -1259,7 +1259,7 @@ fn compute_object_lifetime_defaults(tcx: TyCtxt<'_>) -> HirIdMap<Vec<ObjectLifet
|
||||||
impl_trait_fn: None,
|
impl_trait_fn: None,
|
||||||
..
|
..
|
||||||
})
|
})
|
||||||
| hir::ItemKind::Ty(_, ref generics)
|
| hir::ItemKind::TyAlias(_, ref generics)
|
||||||
| hir::ItemKind::Trait(_, _, ref generics, ..) => {
|
| hir::ItemKind::Trait(_, _, ref generics, ..) => {
|
||||||
let result = object_lifetime_defaults_for_item(tcx, generics);
|
let result = object_lifetime_defaults_for_item(tcx, generics);
|
||||||
|
|
||||||
|
|
|
@ -354,7 +354,7 @@ impl DirtyCleanVisitor<'tcx> {
|
||||||
HirItem::GlobalAsm(..) => ("ItemGlobalAsm", LABELS_HIR_ONLY),
|
HirItem::GlobalAsm(..) => ("ItemGlobalAsm", LABELS_HIR_ONLY),
|
||||||
|
|
||||||
// A type alias, e.g., `type Foo = Bar<u8>`
|
// 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>}`
|
// An enum definition, e.g., `enum Foo<A, B> {C<A>, D<B>}`
|
||||||
HirItem::Enum(..) => ("ItemEnum", LABELS_ADT),
|
HirItem::Enum(..) => ("ItemEnum", LABELS_ADT),
|
||||||
|
@ -405,7 +405,7 @@ impl DirtyCleanVisitor<'tcx> {
|
||||||
match item.node {
|
match item.node {
|
||||||
ImplItemKind::Method(..) => ("Node::ImplItem", LABELS_FN_IN_IMPL),
|
ImplItemKind::Method(..) => ("Node::ImplItem", LABELS_FN_IN_IMPL),
|
||||||
ImplItemKind::Const(..) => ("NodeImplConst", LABELS_CONST_IN_IMPL),
|
ImplItemKind::Const(..) => ("NodeImplConst", LABELS_CONST_IN_IMPL),
|
||||||
ImplItemKind::Type(..) => ("NodeImplType", LABELS_CONST_IN_IMPL),
|
ImplItemKind::TyAlias(..) => ("NodeImplType", LABELS_CONST_IN_IMPL),
|
||||||
ImplItemKind::OpaqueTy(..) => ("NodeImplType", LABELS_CONST_IN_IMPL),
|
ImplItemKind::OpaqueTy(..) => ("NodeImplType", LABELS_CONST_IN_IMPL),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -117,7 +117,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BoxPointers {
|
||||||
fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) {
|
fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) {
|
||||||
match it.node {
|
match it.node {
|
||||||
hir::ItemKind::Fn(..) |
|
hir::ItemKind::Fn(..) |
|
||||||
hir::ItemKind::Ty(..) |
|
hir::ItemKind::TyAlias(..) |
|
||||||
hir::ItemKind::Enum(..) |
|
hir::ItemKind::Enum(..) |
|
||||||
hir::ItemKind::Struct(..) |
|
hir::ItemKind::Struct(..) |
|
||||||
hir::ItemKind::Union(..) => {
|
hir::ItemKind::Union(..) => {
|
||||||
|
@ -406,7 +406,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
|
||||||
}
|
}
|
||||||
"a trait"
|
"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) => {
|
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
|
// If the trait is private, add the impl items to `private_traits` so they don't get
|
||||||
// reported for missing docs.
|
// reported for missing docs.
|
||||||
|
@ -460,7 +460,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
|
||||||
let desc = match impl_item.node {
|
let desc = match impl_item.node {
|
||||||
hir::ImplItemKind::Const(..) => "an associated constant",
|
hir::ImplItemKind::Const(..) => "an associated constant",
|
||||||
hir::ImplItemKind::Method(..) => "a method",
|
hir::ImplItemKind::Method(..) => "a method",
|
||||||
hir::ImplItemKind::Type(_) => "an associated type",
|
hir::ImplItemKind::TyAlias(_) => "an associated type",
|
||||||
hir::ImplItemKind::OpaqueTy(_) => "an associated `impl Trait` type",
|
hir::ImplItemKind::OpaqueTy(_) => "an associated `impl Trait` type",
|
||||||
};
|
};
|
||||||
self.check_missing_docs_attrs(cx,
|
self.check_missing_docs_attrs(cx,
|
||||||
|
@ -1123,7 +1123,7 @@ impl TypeAliasBounds {
|
||||||
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeAliasBounds {
|
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TypeAliasBounds {
|
||||||
fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &hir::Item) {
|
fn check_item(&mut self, cx: &LateContext<'_, '_>, item: &hir::Item) {
|
||||||
let (ty, type_alias_generics) = match item.node {
|
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,
|
_ => return,
|
||||||
};
|
};
|
||||||
let mut suggested_changing_assoc_types = false;
|
let mut suggested_changing_assoc_types = false;
|
||||||
|
|
|
@ -137,7 +137,7 @@ impl EarlyLintPass for NonCamelCaseTypes {
|
||||||
}
|
}
|
||||||
|
|
||||||
match it.node {
|
match it.node {
|
||||||
ast::ItemKind::Ty(..) |
|
ast::ItemKind::TyAlias(..) |
|
||||||
ast::ItemKind::Enum(..) |
|
ast::ItemKind::Enum(..) |
|
||||||
ast::ItemKind::Struct(..) |
|
ast::ItemKind::Struct(..) |
|
||||||
ast::ItemKind::Union(..) => self.check_case(cx, "type", &it.ident),
|
ast::ItemKind::Union(..) => self.check_case(cx, "type", &it.ident),
|
||||||
|
|
|
@ -980,7 +980,7 @@ impl EncodeContext<'tcx> {
|
||||||
needs_inline || is_const_fn || always_encode_mir
|
needs_inline || is_const_fn || always_encode_mir
|
||||||
},
|
},
|
||||||
hir::ImplItemKind::OpaqueTy(..) |
|
hir::ImplItemKind::OpaqueTy(..) |
|
||||||
hir::ImplItemKind::Type(..) => false,
|
hir::ImplItemKind::TyAlias(..) => false,
|
||||||
};
|
};
|
||||||
|
|
||||||
Entry {
|
Entry {
|
||||||
|
@ -1094,7 +1094,7 @@ impl EncodeContext<'tcx> {
|
||||||
}
|
}
|
||||||
hir::ItemKind::ForeignMod(_) => EntryKind::ForeignMod,
|
hir::ItemKind::ForeignMod(_) => EntryKind::ForeignMod,
|
||||||
hir::ItemKind::GlobalAsm(..) => EntryKind::GlobalAsm,
|
hir::ItemKind::GlobalAsm(..) => EntryKind::GlobalAsm,
|
||||||
hir::ItemKind::Ty(..) => EntryKind::Type,
|
hir::ItemKind::TyAlias(..) => EntryKind::Type,
|
||||||
hir::ItemKind::OpaqueTy(..) => EntryKind::OpaqueTy,
|
hir::ItemKind::OpaqueTy(..) => EntryKind::OpaqueTy,
|
||||||
hir::ItemKind::Enum(..) => EntryKind::Enum(get_repr_options(tcx, def_id)),
|
hir::ItemKind::Enum(..) => EntryKind::Enum(get_repr_options(tcx, def_id)),
|
||||||
hir::ItemKind::Struct(ref struct_def, _) => {
|
hir::ItemKind::Struct(ref struct_def, _) => {
|
||||||
|
@ -1227,7 +1227,7 @@ impl EncodeContext<'tcx> {
|
||||||
hir::ItemKind::Static(..) |
|
hir::ItemKind::Static(..) |
|
||||||
hir::ItemKind::Const(..) |
|
hir::ItemKind::Const(..) |
|
||||||
hir::ItemKind::Fn(..) |
|
hir::ItemKind::Fn(..) |
|
||||||
hir::ItemKind::Ty(..) |
|
hir::ItemKind::TyAlias(..) |
|
||||||
hir::ItemKind::OpaqueTy(..) |
|
hir::ItemKind::OpaqueTy(..) |
|
||||||
hir::ItemKind::Enum(..) |
|
hir::ItemKind::Enum(..) |
|
||||||
hir::ItemKind::Struct(..) |
|
hir::ItemKind::Struct(..) |
|
||||||
|
@ -1247,7 +1247,7 @@ impl EncodeContext<'tcx> {
|
||||||
hir::ItemKind::Static(..) |
|
hir::ItemKind::Static(..) |
|
||||||
hir::ItemKind::Const(..) |
|
hir::ItemKind::Const(..) |
|
||||||
hir::ItemKind::Fn(..) |
|
hir::ItemKind::Fn(..) |
|
||||||
hir::ItemKind::Ty(..) |
|
hir::ItemKind::TyAlias(..) |
|
||||||
hir::ItemKind::Enum(..) |
|
hir::ItemKind::Enum(..) |
|
||||||
hir::ItemKind::Struct(..) |
|
hir::ItemKind::Struct(..) |
|
||||||
hir::ItemKind::Union(..) |
|
hir::ItemKind::Union(..) |
|
||||||
|
@ -1261,7 +1261,7 @@ impl EncodeContext<'tcx> {
|
||||||
hir::ItemKind::Static(..) |
|
hir::ItemKind::Static(..) |
|
||||||
hir::ItemKind::Const(..) |
|
hir::ItemKind::Const(..) |
|
||||||
hir::ItemKind::Fn(..) |
|
hir::ItemKind::Fn(..) |
|
||||||
hir::ItemKind::Ty(..) |
|
hir::ItemKind::TyAlias(..) |
|
||||||
hir::ItemKind::Enum(..) |
|
hir::ItemKind::Enum(..) |
|
||||||
hir::ItemKind::Struct(..) |
|
hir::ItemKind::Struct(..) |
|
||||||
hir::ItemKind::Union(..) |
|
hir::ItemKind::Union(..) |
|
||||||
|
@ -1761,7 +1761,7 @@ impl EncodeContext<'tcx> {
|
||||||
hir::ItemKind::GlobalAsm(..) |
|
hir::ItemKind::GlobalAsm(..) |
|
||||||
hir::ItemKind::ExternCrate(..) |
|
hir::ItemKind::ExternCrate(..) |
|
||||||
hir::ItemKind::Use(..) |
|
hir::ItemKind::Use(..) |
|
||||||
hir::ItemKind::Ty(..) |
|
hir::ItemKind::TyAlias(..) |
|
||||||
hir::ItemKind::OpaqueTy(..) |
|
hir::ItemKind::OpaqueTy(..) |
|
||||||
hir::ItemKind::TraitAlias(..) => {
|
hir::ItemKind::TraitAlias(..) => {
|
||||||
// no sub-item recording needed in these cases
|
// no sub-item recording needed in these cases
|
||||||
|
|
|
@ -969,7 +969,7 @@ impl ItemLikeVisitor<'v> for RootCollector<'_, 'v> {
|
||||||
hir::ItemKind::ExternCrate(..) |
|
hir::ItemKind::ExternCrate(..) |
|
||||||
hir::ItemKind::Use(..) |
|
hir::ItemKind::Use(..) |
|
||||||
hir::ItemKind::ForeignMod(..) |
|
hir::ItemKind::ForeignMod(..) |
|
||||||
hir::ItemKind::Ty(..) |
|
hir::ItemKind::TyAlias(..) |
|
||||||
hir::ItemKind::Trait(..) |
|
hir::ItemKind::Trait(..) |
|
||||||
hir::ItemKind::TraitAlias(..) |
|
hir::ItemKind::TraitAlias(..) |
|
||||||
hir::ItemKind::OpaqueTy(..) |
|
hir::ItemKind::OpaqueTy(..) |
|
||||||
|
|
|
@ -31,7 +31,7 @@ impl ItemLikeVisitor<'tcx> for VarianceTest<'tcx> {
|
||||||
fn visit_item(&mut self, item: &'tcx hir::Item) {
|
fn visit_item(&mut self, item: &'tcx hir::Item) {
|
||||||
let item_def_id = self.tcx.hir().local_def_id(item.hir_id);
|
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() {
|
for attr in self.tcx.get_attrs(item_def_id).iter() {
|
||||||
if attr.check_name(sym::rustc_layout) {
|
if attr.check_name(sym::rustc_layout) {
|
||||||
self.dump_layout_of(item_def_id, item, attr);
|
self.dump_layout_of(item_def_id, item, attr);
|
||||||
|
|
|
@ -534,7 +534,7 @@ impl Visitor<'tcx> for EmbargoVisitor<'tcx> {
|
||||||
hir::ItemKind::Static(..) | hir::ItemKind::Struct(..) |
|
hir::ItemKind::Static(..) | hir::ItemKind::Struct(..) |
|
||||||
hir::ItemKind::Trait(..) | hir::ItemKind::TraitAlias(..) |
|
hir::ItemKind::Trait(..) | hir::ItemKind::TraitAlias(..) |
|
||||||
hir::ItemKind::OpaqueTy(..) |
|
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 }
|
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::Static(..) |
|
||||||
hir::ItemKind::Const(..) |
|
hir::ItemKind::Const(..) |
|
||||||
hir::ItemKind::GlobalAsm(..) |
|
hir::ItemKind::GlobalAsm(..) |
|
||||||
hir::ItemKind::Ty(..) |
|
hir::ItemKind::TyAlias(..) |
|
||||||
hir::ItemKind::Mod(..) |
|
hir::ItemKind::Mod(..) |
|
||||||
hir::ItemKind::TraitAlias(..) |
|
hir::ItemKind::TraitAlias(..) |
|
||||||
hir::ItemKind::Fn(..) |
|
hir::ItemKind::Fn(..) |
|
||||||
|
@ -621,7 +621,7 @@ impl Visitor<'tcx> for EmbargoVisitor<'tcx> {
|
||||||
}
|
}
|
||||||
// Visit everything.
|
// Visit everything.
|
||||||
hir::ItemKind::Const(..) | hir::ItemKind::Static(..) |
|
hir::ItemKind::Const(..) | hir::ItemKind::Static(..) |
|
||||||
hir::ItemKind::Fn(..) | hir::ItemKind::Ty(..) => {
|
hir::ItemKind::Fn(..) | hir::ItemKind::TyAlias(..) => {
|
||||||
if item_level.is_some() {
|
if item_level.is_some() {
|
||||||
self.reach(item.hir_id, item_level).generics().predicates().ty();
|
self.reach(item.hir_id, item_level).generics().predicates().ty();
|
||||||
}
|
}
|
||||||
|
@ -1371,7 +1371,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
|
||||||
impl_item_ref.id.hir_id)
|
impl_item_ref.id.hir_id)
|
||||||
}
|
}
|
||||||
hir::ImplItemKind::OpaqueTy(..) |
|
hir::ImplItemKind::OpaqueTy(..) |
|
||||||
hir::ImplItemKind::Type(_) => false,
|
hir::ImplItemKind::TyAlias(_) => false,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1397,7 +1397,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
|
||||||
{
|
{
|
||||||
intravisit::walk_impl_item(self, impl_item)
|
intravisit::walk_impl_item(self, impl_item)
|
||||||
}
|
}
|
||||||
hir::ImplItemKind::Type(..) => {
|
hir::ImplItemKind::TyAlias(..) => {
|
||||||
intravisit::walk_impl_item(self, impl_item)
|
intravisit::walk_impl_item(self, impl_item)
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
|
@ -1423,7 +1423,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
|
||||||
// Those in 3. are warned with this call.
|
// Those in 3. are warned with this call.
|
||||||
for impl_item_ref in impl_item_refs {
|
for impl_item_ref in impl_item_refs {
|
||||||
let impl_item = self.tcx.hir().impl_item(impl_item_ref.id);
|
let impl_item = self.tcx.hir().impl_item(impl_item_ref.id);
|
||||||
if let hir::ImplItemKind::Type(ref ty) = impl_item.node {
|
if let hir::ImplItemKind::TyAlias(ref ty) = impl_item.node {
|
||||||
self.visit_ty(ty);
|
self.visit_ty(ty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1458,7 +1458,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
|
||||||
|
|
||||||
// `type ... = ...;` can contain private types, because
|
// `type ... = ...;` can contain private types, because
|
||||||
// we're introducing a new name.
|
// we're introducing a new name.
|
||||||
hir::ItemKind::Ty(..) => return,
|
hir::ItemKind::TyAlias(..) => return,
|
||||||
|
|
||||||
// Not at all public, so we don't care.
|
// Not at all public, so we don't care.
|
||||||
_ if !self.item_is_public(&item.hir_id, &item.vis) => {
|
_ 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(..) => {}
|
hir::ItemKind::GlobalAsm(..) => {}
|
||||||
// Subitems of these items have inherited publicity.
|
// Subitems of these items have inherited publicity.
|
||||||
hir::ItemKind::Const(..) | hir::ItemKind::Static(..) |
|
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();
|
self.check(item.hir_id, item_visibility).generics().predicates().ty();
|
||||||
}
|
}
|
||||||
hir::ItemKind::OpaqueTy(..) => {
|
hir::ItemKind::OpaqueTy(..) => {
|
||||||
|
|
|
@ -459,7 +459,7 @@ impl<'a> Resolver<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// These items live in the type namespace.
|
// These items live in the type namespace.
|
||||||
ItemKind::Ty(..) => {
|
ItemKind::TyAlias(..) => {
|
||||||
let res = Res::Def(DefKind::TyAlias, self.definitions.local_def_id(item.id));
|
let res = Res::Def(DefKind::TyAlias, self.definitions.local_def_id(item.id));
|
||||||
self.define(parent, ident, TypeNS, (res, vis, sp, expansion));
|
self.define(parent, ident, TypeNS, (res, vis, sp, expansion));
|
||||||
}
|
}
|
||||||
|
|
|
@ -2709,7 +2709,7 @@ impl<'a> Resolver<'a> {
|
||||||
debug!("(resolving item) resolving {} ({:?})", name, item.node);
|
debug!("(resolving item) resolving {} ({:?})", name, item.node);
|
||||||
|
|
||||||
match item.node {
|
match item.node {
|
||||||
ItemKind::Ty(_, ref generics) |
|
ItemKind::TyAlias(_, ref generics) |
|
||||||
ItemKind::OpaqueTy(_, ref generics) |
|
ItemKind::OpaqueTy(_, ref generics) |
|
||||||
ItemKind::Fn(_, _, ref generics, _) => {
|
ItemKind::Fn(_, _, ref generics, _) => {
|
||||||
self.with_generic_param_rib(
|
self.with_generic_param_rib(
|
||||||
|
@ -3079,7 +3079,7 @@ impl<'a> Resolver<'a> {
|
||||||
|
|
||||||
visit::walk_impl_item(this, impl_item);
|
visit::walk_impl_item(this, impl_item);
|
||||||
}
|
}
|
||||||
ImplItemKind::Type(ref ty) => {
|
ImplItemKind::TyAlias(ref ty) => {
|
||||||
// If this is a trait impl, ensure the type
|
// If this is a trait impl, ensure the type
|
||||||
// exists in trait
|
// exists in trait
|
||||||
this.check_trait_item(impl_item.ident,
|
this.check_trait_item(impl_item.ident,
|
||||||
|
|
|
@ -1167,7 +1167,7 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> {
|
||||||
impl_item.span,
|
impl_item.span,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
ast::ImplItemKind::Type(ref ty) => {
|
ast::ImplItemKind::TyAlias(ref ty) => {
|
||||||
// FIXME: uses of the assoc type should ideally point to this
|
// FIXME: uses of the assoc type should ideally point to this
|
||||||
// 'def' and the name here should be a ref to the def in the
|
// 'def' and the name here should be a ref to the def in the
|
||||||
// trait.
|
// trait.
|
||||||
|
@ -1397,7 +1397,7 @@ impl<'l, 'tcx> Visitor<'l> for DumpVisitor<'l, 'tcx> {
|
||||||
self.process_mod(item);
|
self.process_mod(item);
|
||||||
visit::walk_mod(self, m);
|
visit::walk_mod(self, m);
|
||||||
}
|
}
|
||||||
Ty(ref ty, ref ty_params) => {
|
TyAlias(ref ty, ref ty_params) => {
|
||||||
let qualname = format!("::{}",
|
let qualname = format!("::{}",
|
||||||
self.tcx.def_path_str(self.tcx.hir().local_def_id_from_node_id(item.id)));
|
self.tcx.def_path_str(self.tcx.hir().local_def_id_from_node_id(item.id)));
|
||||||
let value = ty_to_string(&ty);
|
let value = ty_to_string(&ty);
|
||||||
|
|
|
@ -438,7 +438,7 @@ impl Sig for ast::Item {
|
||||||
refs: vec![],
|
refs: vec![],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
ast::ItemKind::Ty(ref ty, ref generics) => {
|
ast::ItemKind::TyAlias(ref ty, ref generics) => {
|
||||||
let text = "type ".to_owned();
|
let text = "type ".to_owned();
|
||||||
let mut sig = name_and_generics(text, offset, generics, self.id, self.ident, scx)?;
|
let mut sig = name_and_generics(text, offset, generics, self.id, self.ident, scx)?;
|
||||||
|
|
||||||
|
|
|
@ -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);
|
let substs = InternalSubsts::identity_for_item(tcx, def_id);
|
||||||
check_opaque(tcx, def_id, substs, it.span, &origin);
|
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 def_id = tcx.hir().local_def_id(it.hir_id);
|
||||||
let pty_ty = tcx.type_of(def_id);
|
let pty_ty = tcx.type_of(def_id);
|
||||||
let generics = tcx.generics_of(def_id);
|
let generics = tcx.generics_of(def_id);
|
||||||
|
@ -1543,7 +1543,7 @@ fn check_specialization_validity<'tcx>(
|
||||||
hir::ImplItemKind::Const(..) => ty::AssocKind::Const,
|
hir::ImplItemKind::Const(..) => ty::AssocKind::Const,
|
||||||
hir::ImplItemKind::Method(..) => ty::AssocKind::Method,
|
hir::ImplItemKind::Method(..) => ty::AssocKind::Method,
|
||||||
hir::ImplItemKind::OpaqueTy(..) => ty::AssocKind::OpaqueTy,
|
hir::ImplItemKind::OpaqueTy(..) => ty::AssocKind::OpaqueTy,
|
||||||
hir::ImplItemKind::Type(_) => ty::AssocKind::Type
|
hir::ImplItemKind::TyAlias(_) => ty::AssocKind::Type,
|
||||||
};
|
};
|
||||||
|
|
||||||
let parent = ancestors.defs(tcx, trait_item.ident, kind, trait_def.def_id).nth(1)
|
let parent = ancestors.defs(tcx, trait_item.ident, kind, trait_def.def_id).nth(1)
|
||||||
|
@ -1640,7 +1640,7 @@ fn check_impl_items_against_trait<'tcx>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hir::ImplItemKind::OpaqueTy(..) |
|
hir::ImplItemKind::OpaqueTy(..) |
|
||||||
hir::ImplItemKind::Type(_) => {
|
hir::ImplItemKind::TyAlias(_) => {
|
||||||
if ty_trait_item.kind == ty::AssocKind::Type {
|
if ty_trait_item.kind == ty::AssocKind::Type {
|
||||||
if ty_trait_item.defaultness.has_value() {
|
if ty_trait_item.defaultness.has_value() {
|
||||||
overridden_associated_type = Some(impl_item);
|
overridden_associated_type = Some(impl_item);
|
||||||
|
|
|
@ -293,7 +293,7 @@ fn type_param_predicates(
|
||||||
match item.node {
|
match item.node {
|
||||||
ItemKind::Fn(.., ref generics, _)
|
ItemKind::Fn(.., ref generics, _)
|
||||||
| ItemKind::Impl(_, _, _, ref generics, ..)
|
| ItemKind::Impl(_, _, _, ref generics, ..)
|
||||||
| ItemKind::Ty(_, ref generics)
|
| ItemKind::TyAlias(_, ref generics)
|
||||||
| ItemKind::OpaqueTy(OpaqueTy {
|
| ItemKind::OpaqueTy(OpaqueTy {
|
||||||
ref generics,
|
ref generics,
|
||||||
impl_trait_fn: None,
|
impl_trait_fn: None,
|
||||||
|
@ -462,7 +462,7 @@ fn convert_item(tcx: TyCtxt<'_>, item_id: hir::HirId) {
|
||||||
}) => {}
|
}) => {}
|
||||||
|
|
||||||
hir::ItemKind::OpaqueTy(..)
|
hir::ItemKind::OpaqueTy(..)
|
||||||
| hir::ItemKind::Ty(..)
|
| hir::ItemKind::TyAlias(..)
|
||||||
| hir::ItemKind::Static(..)
|
| hir::ItemKind::Static(..)
|
||||||
| hir::ItemKind::Const(..)
|
| hir::ItemKind::Const(..)
|
||||||
| hir::ItemKind::Fn(..) => {
|
| hir::ItemKind::Fn(..) => {
|
||||||
|
@ -917,7 +917,7 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::Generics {
|
||||||
generics
|
generics
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemKind::Ty(_, ref generics)
|
ItemKind::TyAlias(_, ref generics)
|
||||||
| ItemKind::Enum(_, ref generics)
|
| ItemKind::Enum(_, ref generics)
|
||||||
| ItemKind::Struct(_, ref generics)
|
| ItemKind::Struct(_, ref generics)
|
||||||
| ItemKind::OpaqueTy(hir::OpaqueTy { ref generics, .. })
|
| ItemKind::OpaqueTy(hir::OpaqueTy { ref generics, .. })
|
||||||
|
@ -1220,7 +1220,7 @@ pub fn checked_type_of(tcx: TyCtxt<'_>, def_id: DefId, fail: bool) -> Option<Ty<
|
||||||
|
|
||||||
find_opaque_ty_constraints(tcx, def_id)
|
find_opaque_ty_constraints(tcx, def_id)
|
||||||
}
|
}
|
||||||
ImplItemKind::Type(ref ty) => {
|
ImplItemKind::TyAlias(ref ty) => {
|
||||||
if tcx
|
if tcx
|
||||||
.impl_trait_ref(tcx.hir().get_parent_did(hir_id))
|
.impl_trait_ref(tcx.hir().get_parent_did(hir_id))
|
||||||
.is_none()
|
.is_none()
|
||||||
|
@ -1242,7 +1242,7 @@ pub fn checked_type_of(tcx: TyCtxt<'_>, def_id: DefId, fail: bool) -> Option<Ty<
|
||||||
icx.to_ty(ty)
|
icx.to_ty(ty)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ItemKind::Ty(ref ty, _)
|
ItemKind::TyAlias(ref ty, _)
|
||||||
| ItemKind::Impl(.., ref ty, _) => icx.to_ty(ty),
|
| ItemKind::Impl(.., ref ty, _) => icx.to_ty(ty),
|
||||||
ItemKind::Fn(..) => {
|
ItemKind::Fn(..) => {
|
||||||
let substs = InternalSubsts::identity_for_item(tcx, def_id);
|
let substs = InternalSubsts::identity_for_item(tcx, def_id);
|
||||||
|
@ -2038,7 +2038,7 @@ fn explicit_predicates_of(
|
||||||
generics
|
generics
|
||||||
}
|
}
|
||||||
ItemKind::Fn(.., ref generics, _)
|
ItemKind::Fn(.., ref generics, _)
|
||||||
| ItemKind::Ty(_, ref generics)
|
| ItemKind::TyAlias(_, ref generics)
|
||||||
| ItemKind::Enum(_, ref generics)
|
| ItemKind::Enum(_, ref generics)
|
||||||
| ItemKind::Struct(_, ref generics)
|
| ItemKind::Struct(_, ref generics)
|
||||||
| ItemKind::Union(_, ref generics) => generics,
|
| ItemKind::Union(_, ref generics) => generics,
|
||||||
|
|
|
@ -189,7 +189,7 @@ fn enforce_impl_items_are_distinct(tcx: TyCtxt<'_>, impl_item_refs: &[hir::ImplI
|
||||||
for impl_item_ref in impl_item_refs {
|
for impl_item_ref in impl_item_refs {
|
||||||
let impl_item = tcx.hir().impl_item(impl_item_ref.id);
|
let impl_item = tcx.hir().impl_item(impl_item_ref.id);
|
||||||
let seen_items = match impl_item.node {
|
let seen_items = match impl_item.node {
|
||||||
hir::ImplItemKind::Type(_) => &mut seen_type_items,
|
hir::ImplItemKind::TyAlias(_) => &mut seen_type_items,
|
||||||
_ => &mut seen_value_items,
|
_ => &mut seen_value_items,
|
||||||
};
|
};
|
||||||
match seen_items.entry(impl_item.ident.modern()) {
|
match seen_items.entry(impl_item.ident.modern()) {
|
||||||
|
|
|
@ -23,7 +23,7 @@ impl<'a> From <&'a hir::ImplItemKind> for Namespace {
|
||||||
fn from(impl_kind: &'a hir::ImplItemKind) -> Self {
|
fn from(impl_kind: &'a hir::ImplItemKind) -> Self {
|
||||||
match *impl_kind {
|
match *impl_kind {
|
||||||
hir::ImplItemKind::OpaqueTy(..) |
|
hir::ImplItemKind::OpaqueTy(..) |
|
||||||
hir::ImplItemKind::Type(..) => Namespace::Type,
|
hir::ImplItemKind::TyAlias(..) => Namespace::Type,
|
||||||
hir::ImplItemKind::Const(..) |
|
hir::ImplItemKind::Const(..) |
|
||||||
hir::ImplItemKind::Method(..) => Namespace::Value,
|
hir::ImplItemKind::Method(..) => Namespace::Value,
|
||||||
}
|
}
|
||||||
|
|
|
@ -2253,7 +2253,7 @@ impl Clean<Item> for hir::ImplItem {
|
||||||
hir::ImplItemKind::Method(ref sig, body) => {
|
hir::ImplItemKind::Method(ref sig, body) => {
|
||||||
MethodItem((sig, &self.generics, body, Some(self.defaultness)).clean(cx))
|
MethodItem((sig, &self.generics, body, Some(self.defaultness)).clean(cx))
|
||||||
}
|
}
|
||||||
hir::ImplItemKind::Type(ref ty) => TypedefItem(Typedef {
|
hir::ImplItemKind::TyAlias(ref ty) => TypedefItem(Typedef {
|
||||||
type_: ty.clean(cx),
|
type_: ty.clean(cx),
|
||||||
generics: Generics::default(),
|
generics: Generics::default(),
|
||||||
}, true),
|
}, true),
|
||||||
|
@ -2802,7 +2802,7 @@ impl Clean<Type> 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 provided_params = &path.segments.last().expect("segments were empty");
|
||||||
let mut ty_substs = FxHashMap::default();
|
let mut ty_substs = FxHashMap::default();
|
||||||
let mut lt_substs = FxHashMap::default();
|
let mut lt_substs = FxHashMap::default();
|
||||||
|
|
|
@ -458,7 +458,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
|
||||||
om.unions.push(self.visit_union_data(item, ident.name, sd, gen)),
|
om.unions.push(self.visit_union_data(item, ident.name, sd, gen)),
|
||||||
hir::ItemKind::Fn(ref fd, header, ref gen, body) =>
|
hir::ItemKind::Fn(ref fd, header, ref gen, body) =>
|
||||||
self.visit_fn(om, item, ident.name, &**fd, header, 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 {
|
let t = Typedef {
|
||||||
ty,
|
ty,
|
||||||
gen,
|
gen,
|
||||||
|
|
|
@ -1509,7 +1509,7 @@ pub struct ImplItem {
|
||||||
pub enum ImplItemKind {
|
pub enum ImplItemKind {
|
||||||
Const(P<Ty>, P<Expr>),
|
Const(P<Ty>, P<Expr>),
|
||||||
Method(MethodSig, P<Block>),
|
Method(MethodSig, P<Block>),
|
||||||
Type(P<Ty>),
|
TyAlias(P<Ty>),
|
||||||
OpaqueTy(GenericBounds),
|
OpaqueTy(GenericBounds),
|
||||||
Macro(Mac),
|
Macro(Mac),
|
||||||
}
|
}
|
||||||
|
@ -2346,7 +2346,7 @@ pub enum ItemKind {
|
||||||
/// A type alias (`type` or `pub type`).
|
/// A type alias (`type` or `pub type`).
|
||||||
///
|
///
|
||||||
/// E.g., `type Foo = Bar<u8>;`.
|
/// E.g., `type Foo = Bar<u8>;`.
|
||||||
Ty(P<Ty>, Generics),
|
TyAlias(P<Ty>, Generics),
|
||||||
/// An opaque `impl Trait` type alias.
|
/// An opaque `impl Trait` type alias.
|
||||||
///
|
///
|
||||||
/// E.g., `type Foo = impl Bar + Boo;`.
|
/// E.g., `type Foo = impl Bar + Boo;`.
|
||||||
|
@ -2403,7 +2403,7 @@ impl ItemKind {
|
||||||
ItemKind::Mod(..) => "module",
|
ItemKind::Mod(..) => "module",
|
||||||
ItemKind::ForeignMod(..) => "foreign module",
|
ItemKind::ForeignMod(..) => "foreign module",
|
||||||
ItemKind::GlobalAsm(..) => "global asm",
|
ItemKind::GlobalAsm(..) => "global asm",
|
||||||
ItemKind::Ty(..) => "type alias",
|
ItemKind::TyAlias(..) => "type alias",
|
||||||
ItemKind::OpaqueTy(..) => "opaque type",
|
ItemKind::OpaqueTy(..) => "opaque type",
|
||||||
ItemKind::Enum(..) => "enum",
|
ItemKind::Enum(..) => "enum",
|
||||||
ItemKind::Struct(..) => "struct",
|
ItemKind::Struct(..) => "struct",
|
||||||
|
|
|
@ -858,7 +858,7 @@ impl<'a> ExtCtxt<'a> {
|
||||||
|
|
||||||
pub fn item_ty_poly(&self, span: Span, name: Ident, ty: P<ast::Ty>,
|
pub fn item_ty_poly(&self, span: Span, name: Ident, ty: P<ast::Ty>,
|
||||||
generics: Generics) -> P<ast::Item> {
|
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> {
|
pub fn item_ty(&self, span: Span, name: Ident, ty: P<ast::Ty>) -> P<ast::Item> {
|
||||||
|
|
|
@ -2254,7 +2254,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
|
||||||
"`impl Trait` in type aliases is unstable"
|
"`impl Trait` in type aliases is unstable"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
ast::ImplItemKind::Type(_) => {
|
ast::ImplItemKind::TyAlias(_) => {
|
||||||
if !ii.generics.params.is_empty() {
|
if !ii.generics.params.is_empty() {
|
||||||
gate_feature_post!(&self, generic_associated_types, ii.span,
|
gate_feature_post!(&self, generic_associated_types, ii.span,
|
||||||
"generic associated types are unstable");
|
"generic associated types are unstable");
|
||||||
|
|
|
@ -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::Mod(m) => vis.visit_mod(m),
|
||||||
ItemKind::ForeignMod(nm) => vis.visit_foreign_mod(nm),
|
ItemKind::ForeignMod(nm) => vis.visit_foreign_mod(nm),
|
||||||
ItemKind::GlobalAsm(_ga) => {}
|
ItemKind::GlobalAsm(_ga) => {}
|
||||||
ItemKind::Ty(ty, generics) => {
|
ItemKind::TyAlias(ty, generics) => {
|
||||||
vis.visit_ty(ty);
|
vis.visit_ty(ty);
|
||||||
vis.visit_generics(generics);
|
vis.visit_generics(generics);
|
||||||
}
|
}
|
||||||
|
@ -933,7 +933,7 @@ pub fn noop_flat_map_impl_item<T: MutVisitor>(mut item: ImplItem, visitor: &mut
|
||||||
visit_method_sig(sig, visitor);
|
visit_method_sig(sig, visitor);
|
||||||
visitor.visit_block(body);
|
visitor.visit_block(body);
|
||||||
}
|
}
|
||||||
ImplItemKind::Type(ty) => visitor.visit_ty(ty),
|
ImplItemKind::TyAlias(ty) => visitor.visit_ty(ty),
|
||||||
ImplItemKind::OpaqueTy(bounds) => visit_bounds(bounds, visitor),
|
ImplItemKind::OpaqueTy(bounds) => visit_bounds(bounds, visitor),
|
||||||
ImplItemKind::Macro(mac) => visitor.visit_mac(mac),
|
ImplItemKind::Macro(mac) => visitor.visit_mac(mac),
|
||||||
}
|
}
|
||||||
|
|
|
@ -5707,7 +5707,7 @@ impl<'a> Parser<'a> {
|
||||||
let (name, node, generics) = if let Some(type_) = self.eat_type() {
|
let (name, node, generics) = if let Some(type_) = self.eat_type() {
|
||||||
let (name, alias, generics) = type_?;
|
let (name, alias, generics) = type_?;
|
||||||
let kind = match alias {
|
let kind = match alias {
|
||||||
AliasKind::Weak(typ) => ast::ImplItemKind::Type(typ),
|
AliasKind::Weak(typ) => ast::ImplItemKind::TyAlias(typ),
|
||||||
AliasKind::OpaqueTy(bounds) => ast::ImplItemKind::OpaqueTy(bounds),
|
AliasKind::OpaqueTy(bounds) => ast::ImplItemKind::OpaqueTy(bounds),
|
||||||
};
|
};
|
||||||
(name, kind, generics)
|
(name, kind, generics)
|
||||||
|
@ -7263,7 +7263,7 @@ impl<'a> Parser<'a> {
|
||||||
let (ident, alias, generics) = type_?;
|
let (ident, alias, generics) = type_?;
|
||||||
// TYPE ITEM
|
// TYPE ITEM
|
||||||
let item_ = match alias {
|
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),
|
AliasKind::OpaqueTy(bounds) => ItemKind::OpaqueTy(bounds, generics),
|
||||||
};
|
};
|
||||||
let prev_span = self.prev_span;
|
let prev_span = self.prev_span;
|
||||||
|
|
|
@ -1208,7 +1208,7 @@ impl<'a> State<'a> {
|
||||||
self.s.word(ga.asm.as_str().to_string());
|
self.s.word(ga.asm.as_str().to_string());
|
||||||
self.end();
|
self.end();
|
||||||
}
|
}
|
||||||
ast::ItemKind::Ty(ref ty, ref generics) => {
|
ast::ItemKind::TyAlias(ref ty, ref generics) => {
|
||||||
self.head(visibility_qualified(&item.vis, "type"));
|
self.head(visibility_qualified(&item.vis, "type"));
|
||||||
self.print_ident(item.ident);
|
self.print_ident(item.ident);
|
||||||
self.print_generic_params(&generics.params);
|
self.print_generic_params(&generics.params);
|
||||||
|
@ -1579,7 +1579,7 @@ impl<'a> State<'a> {
|
||||||
self.nbsp();
|
self.nbsp();
|
||||||
self.print_block_with_attrs(body, &ii.attrs);
|
self.print_block_with_attrs(body, &ii.attrs);
|
||||||
}
|
}
|
||||||
ast::ImplItemKind::Type(ref ty) => {
|
ast::ImplItemKind::TyAlias(ref ty) => {
|
||||||
self.print_associated_type(ii.ident, None, Some(ty));
|
self.print_associated_type(ii.ident, None, Some(ty));
|
||||||
}
|
}
|
||||||
ast::ImplItemKind::OpaqueTy(ref bounds) => {
|
ast::ImplItemKind::OpaqueTy(ref bounds) => {
|
||||||
|
|
|
@ -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);
|
walk_list!(visitor, visit_foreign_item, &foreign_module.items);
|
||||||
}
|
}
|
||||||
ItemKind::GlobalAsm(ref ga) => visitor.visit_global_asm(ga),
|
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_ty(typ);
|
||||||
visitor.visit_generics(generics)
|
visitor.visit_generics(generics)
|
||||||
}
|
}
|
||||||
|
@ -616,7 +616,7 @@ pub fn walk_impl_item<'a, V: Visitor<'a>>(visitor: &mut V, impl_item: &'a ImplIt
|
||||||
visitor.visit_fn(FnKind::Method(impl_item.ident, sig, Some(&impl_item.vis), body),
|
visitor.visit_fn(FnKind::Method(impl_item.ident, sig, Some(&impl_item.vis), body),
|
||||||
&sig.decl, impl_item.span, impl_item.id);
|
&sig.decl, impl_item.span, impl_item.id);
|
||||||
}
|
}
|
||||||
ImplItemKind::Type(ref ty) => {
|
ImplItemKind::TyAlias(ref ty) => {
|
||||||
visitor.visit_ty(ty);
|
visitor.visit_ty(ty);
|
||||||
}
|
}
|
||||||
ImplItemKind::OpaqueTy(ref bounds) => {
|
ImplItemKind::OpaqueTy(ref bounds) => {
|
||||||
|
|
|
@ -529,7 +529,8 @@ impl<'a> TraitDef<'a> {
|
||||||
defaultness: ast::Defaultness::Final,
|
defaultness: ast::Defaultness::Final,
|
||||||
attrs: Vec::new(),
|
attrs: Vec::new(),
|
||||||
generics: Generics::default(),
|
generics: Generics::default(),
|
||||||
node: ast::ImplItemKind::Type(type_def.to_ty(cx, self.span, type_ident, generics)),
|
node: ast::ImplItemKind::TyAlias(
|
||||||
|
type_def.to_ty(cx, self.span, type_ident, generics)),
|
||||||
tokens: None,
|
tokens: None,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue