@@ -2950,8 +2950,7 @@ impl Item {
29502950 | ItemKind :: GlobalAsm ( _)
29512951 | ItemKind :: MacCall ( _)
29522952 | ItemKind :: Delegation ( _)
2953- | ItemKind :: DelegationList ( _)
2954- | ItemKind :: DelegationGlob ( _)
2953+ | ItemKind :: DelegationMac ( _)
29552954 | ItemKind :: MacroDef ( _) => None ,
29562955 ItemKind :: Static ( _) => None ,
29572956 ItemKind :: Const ( i) => Some ( & i. generics ) ,
@@ -3120,17 +3119,11 @@ pub struct Delegation {
31203119}
31213120
31223121#[ derive( Clone , Encodable , Decodable , Debug ) ]
3123- pub struct DelegationList {
3124- pub qself : Option < P < QSelf > > ,
3125- pub prefix : Path ,
3126- pub suffixes : ThinVec < Ident > ,
3127- pub body : Option < P < Block > > ,
3128- }
3129-
3130- #[ derive( Clone , Encodable , Decodable , Debug ) ]
3131- pub struct DelegationGlob {
3122+ pub struct DelegationMac {
31323123 pub qself : Option < P < QSelf > > ,
31333124 pub prefix : Path ,
3125+ // Some for list delegation, and None for glob delegation
3126+ pub suffixes : Option < ThinVec < Ident > > ,
31343127 pub body : Option < P < Block > > ,
31353128}
31363129
@@ -3224,12 +3217,9 @@ pub enum ItemKind {
32243217 ///
32253218 /// E.g. `reuse <Type as Trait>::name { target_expr_template }`.
32263219 Delegation ( Box < Delegation > ) ,
3227- /// A list delegation item (`reuse prefix::{a, b, c}`).
3228- /// Treated similarly to a macro call and expanded early.
3229- DelegationList ( Box < DelegationList > ) ,
3230- /// A glob delegation item (`reuse prefix::*`).
3220+ /// A list or glob delegation item (`reuse prefix::{a, b, c}`, `reuse prefix::*`).
32313221 /// Treated similarly to a macro call and expanded early.
3232- DelegationGlob ( Box < DelegationGlob > ) ,
3222+ DelegationMac ( Box < DelegationMac > ) ,
32333223}
32343224
32353225impl ItemKind {
@@ -3238,7 +3228,7 @@ impl ItemKind {
32383228 match self {
32393229 Use ( ..) | Static ( ..) | Const ( ..) | Fn ( ..) | Mod ( ..) | GlobalAsm ( ..) | TyAlias ( ..)
32403230 | Struct ( ..) | Union ( ..) | Trait ( ..) | TraitAlias ( ..) | MacroDef ( ..)
3241- | Delegation ( ..) | DelegationList ( .. ) | DelegationGlob ( ..) => "a" ,
3231+ | Delegation ( ..) | DelegationMac ( ..) => "a" ,
32423232 ExternCrate ( ..) | ForeignMod ( ..) | MacCall ( ..) | Enum ( ..) | Impl { .. } => "an" ,
32433233 }
32443234 }
@@ -3263,8 +3253,7 @@ impl ItemKind {
32633253 ItemKind :: MacroDef ( ..) => "macro definition" ,
32643254 ItemKind :: Impl { .. } => "implementation" ,
32653255 ItemKind :: Delegation ( ..) => "delegated function" ,
3266- ItemKind :: DelegationList ( ..) => "delegation list" ,
3267- ItemKind :: DelegationGlob ( ..) => "delegation glob" ,
3256+ ItemKind :: DelegationMac ( ..) => "delegation" ,
32683257 }
32693258 }
32703259
@@ -3308,10 +3297,8 @@ pub enum AssocItemKind {
33083297 MacCall ( P < MacCall > ) ,
33093298 /// An associated delegation item.
33103299 Delegation ( Box < Delegation > ) ,
3311- /// An associated delegation item list.
3312- DelegationList ( Box < DelegationList > ) ,
3313- /// An associated delegation item glob.
3314- DelegationGlob ( Box < DelegationGlob > ) ,
3300+ /// An associated list or glob delegation item.
3301+ DelegationMac ( Box < DelegationMac > ) ,
33153302}
33163303
33173304impl AssocItemKind {
@@ -3322,8 +3309,7 @@ impl AssocItemKind {
33223309 | Self :: Type ( box TyAlias { defaultness, .. } ) => defaultness,
33233310 Self :: MacCall ( ..)
33243311 | Self :: Delegation ( ..)
3325- | Self :: DelegationList ( ..)
3326- | Self :: DelegationGlob ( ..) => Defaultness :: Final ,
3312+ | Self :: DelegationMac ( ..) => Defaultness :: Final ,
33273313 }
33283314 }
33293315}
@@ -3336,8 +3322,7 @@ impl From<AssocItemKind> for ItemKind {
33363322 AssocItemKind :: Type ( ty_alias_kind) => ItemKind :: TyAlias ( ty_alias_kind) ,
33373323 AssocItemKind :: MacCall ( a) => ItemKind :: MacCall ( a) ,
33383324 AssocItemKind :: Delegation ( delegation) => ItemKind :: Delegation ( delegation) ,
3339- AssocItemKind :: DelegationList ( delegation) => ItemKind :: DelegationList ( delegation) ,
3340- AssocItemKind :: DelegationGlob ( delegation) => ItemKind :: DelegationGlob ( delegation) ,
3325+ AssocItemKind :: DelegationMac ( delegation) => ItemKind :: DelegationMac ( delegation) ,
33413326 }
33423327 }
33433328}
@@ -3352,8 +3337,7 @@ impl TryFrom<ItemKind> for AssocItemKind {
33523337 ItemKind :: TyAlias ( ty_kind) => AssocItemKind :: Type ( ty_kind) ,
33533338 ItemKind :: MacCall ( a) => AssocItemKind :: MacCall ( a) ,
33543339 ItemKind :: Delegation ( d) => AssocItemKind :: Delegation ( d) ,
3355- ItemKind :: DelegationList ( d) => AssocItemKind :: DelegationList ( d) ,
3356- ItemKind :: DelegationGlob ( d) => AssocItemKind :: DelegationGlob ( d) ,
3340+ ItemKind :: DelegationMac ( d) => AssocItemKind :: DelegationMac ( d) ,
33573341 _ => return Err ( item_kind) ,
33583342 } )
33593343 }
0 commit comments