@@ -2891,7 +2891,11 @@ pub struct Fn {
2891
2891
}
2892
2892
2893
2893
#[ derive( Clone , Encodable , Decodable , Debug ) ]
2894
- pub struct Static ( pub P < Ty > , pub Mutability , pub Option < P < Expr > > ) ;
2894
+ pub struct Static {
2895
+ pub ty : P < Ty > ,
2896
+ pub mutability : Mutability ,
2897
+ pub expr : Option < P < Expr > > ,
2898
+ }
2895
2899
2896
2900
#[ derive( Clone , Encodable , Decodable , Debug ) ]
2897
2901
pub enum ItemKind {
@@ -2978,7 +2982,7 @@ impl ItemKind {
2978
2982
match self {
2979
2983
ItemKind :: ExternCrate ( ..) => "extern crate" ,
2980
2984
ItemKind :: Use ( ..) => "`use` import" ,
2981
- ItemKind :: Static ( Static ( .. ) ) => "static item" ,
2985
+ ItemKind :: Static ( .. ) => "static item" ,
2982
2986
ItemKind :: Const ( ..) => "constant item" ,
2983
2987
ItemKind :: Fn ( ..) => "function" ,
2984
2988
ItemKind :: Mod ( ..) => "module" ,
@@ -3087,7 +3091,9 @@ pub enum ForeignItemKind {
3087
3091
impl From < ForeignItemKind > for ItemKind {
3088
3092
fn from ( foreign_item_kind : ForeignItemKind ) -> ItemKind {
3089
3093
match foreign_item_kind {
3090
- ForeignItemKind :: Static ( a, b, c) => ItemKind :: Static ( Static ( a, b, c) ) ,
3094
+ ForeignItemKind :: Static ( a, b, c) => {
3095
+ ItemKind :: Static ( Static { ty : a, mutability : b, expr : c } )
3096
+ }
3091
3097
ForeignItemKind :: Fn ( fn_kind) => ItemKind :: Fn ( fn_kind) ,
3092
3098
ForeignItemKind :: TyAlias ( ty_alias_kind) => ItemKind :: TyAlias ( ty_alias_kind) ,
3093
3099
ForeignItemKind :: MacCall ( a) => ItemKind :: MacCall ( a) ,
@@ -3100,7 +3106,9 @@ impl TryFrom<ItemKind> for ForeignItemKind {
3100
3106
3101
3107
fn try_from ( item_kind : ItemKind ) -> Result < ForeignItemKind , ItemKind > {
3102
3108
Ok ( match item_kind {
3103
- ItemKind :: Static ( Static ( a, b, c) ) => ForeignItemKind :: Static ( a, b, c) ,
3109
+ ItemKind :: Static ( Static { ty : a, mutability : b, expr : c } ) => {
3110
+ ForeignItemKind :: Static ( a, b, c)
3111
+ }
3104
3112
ItemKind :: Fn ( fn_kind) => ForeignItemKind :: Fn ( fn_kind) ,
3105
3113
ItemKind :: TyAlias ( ty_alias_kind) => ForeignItemKind :: TyAlias ( ty_alias_kind) ,
3106
3114
ItemKind :: MacCall ( a) => ForeignItemKind :: MacCall ( a) ,
0 commit comments