@@ -2600,35 +2600,8 @@ impl ItemKind {
2600
2600
}
2601
2601
}
2602
2602
2603
- pub type ForeignItem = Item < ForeignItemKind > ;
2604
-
2605
- /// An item within an `extern` block.
2606
- #[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
2607
- pub enum ForeignItemKind {
2608
- /// A constant, `const $ident: $ty $def?;` where `def ::= "=" $expr? ;`.
2609
- /// If `def` is parsed, then the constant is provided, and otherwise required.
2610
- Const ( P < Ty > , Option < P < Expr > > ) ,
2611
- /// A static item (`static FOO: u8`).
2612
- Static ( P < Ty > , Mutability , Option < P < Expr > > ) ,
2613
- /// A function.
2614
- Fn ( FnSig , Generics , Option < P < Block > > ) ,
2615
- /// A type.
2616
- TyAlias ( Generics , GenericBounds , Option < P < Ty > > ) ,
2617
- /// A macro expanding to an item.
2618
- Macro ( Mac ) ,
2619
- }
2620
-
2621
- impl ForeignItemKind {
2622
- pub fn descriptive_variant ( & self ) -> & str {
2623
- match * self {
2624
- ForeignItemKind :: Fn ( ..) => "foreign function" ,
2625
- ForeignItemKind :: Const ( ..) => "foreign const item" ,
2626
- ForeignItemKind :: Static ( ..) => "foreign static item" ,
2627
- ForeignItemKind :: TyAlias ( ..) => "foreign type" ,
2628
- ForeignItemKind :: Macro ( ..) => "macro in foreign module" ,
2629
- }
2630
- }
2631
- }
2603
+ pub type ForeignItem = Item < AssocItemKind > ;
2604
+ pub type ForeignItemKind = AssocItemKind ;
2632
2605
2633
2606
/// Represents associated items.
2634
2607
/// These include items in `impl` and `trait` definitions.
@@ -2646,7 +2619,7 @@ pub struct AssocItem {
2646
2619
pub tokens : Option < TokenStream > ,
2647
2620
}
2648
2621
2649
- /// Represents various kinds of content within an `impl` .
2622
+ /// Represents non-free item kinds .
2650
2623
///
2651
2624
/// The term "provided" in the variants below refers to the item having a default
2652
2625
/// definition / body. Meanwhile, a "required" item lacks a definition / body.
0 commit comments