@@ -2891,7 +2891,11 @@ pub struct Fn {
28912891}
28922892
28932893#[ 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+ }
28952899
28962900#[ derive( Clone , Encodable , Decodable , Debug ) ]
28972901pub enum ItemKind {
@@ -2978,7 +2982,7 @@ impl ItemKind {
29782982 match self {
29792983 ItemKind :: ExternCrate ( ..) => "extern crate" ,
29802984 ItemKind :: Use ( ..) => "`use` import" ,
2981- ItemKind :: Static ( Static ( .. ) ) => "static item" ,
2985+ ItemKind :: Static ( .. ) => "static item" ,
29822986 ItemKind :: Const ( ..) => "constant item" ,
29832987 ItemKind :: Fn ( ..) => "function" ,
29842988 ItemKind :: Mod ( ..) => "module" ,
@@ -3087,7 +3091,9 @@ pub enum ForeignItemKind {
30873091impl From < ForeignItemKind > for ItemKind {
30883092 fn from ( foreign_item_kind : ForeignItemKind ) -> ItemKind {
30893093 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+ }
30913097 ForeignItemKind :: Fn ( fn_kind) => ItemKind :: Fn ( fn_kind) ,
30923098 ForeignItemKind :: TyAlias ( ty_alias_kind) => ItemKind :: TyAlias ( ty_alias_kind) ,
30933099 ForeignItemKind :: MacCall ( a) => ItemKind :: MacCall ( a) ,
@@ -3100,7 +3106,9 @@ impl TryFrom<ItemKind> for ForeignItemKind {
31003106
31013107 fn try_from ( item_kind : ItemKind ) -> Result < ForeignItemKind , ItemKind > {
31023108 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+ }
31043112 ItemKind :: Fn ( fn_kind) => ForeignItemKind :: Fn ( fn_kind) ,
31053113 ItemKind :: TyAlias ( ty_alias_kind) => ForeignItemKind :: TyAlias ( ty_alias_kind) ,
31063114 ItemKind :: MacCall ( a) => ForeignItemKind :: MacCall ( a) ,
0 commit comments