@@ -786,7 +786,12 @@ impl UnOp {
786
786
}
787
787
788
788
/// A statement
789
- pub type Stmt = Spanned < StmtKind > ;
789
+ #[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash ) ]
790
+ pub struct Stmt {
791
+ pub id : NodeId ,
792
+ pub node : StmtKind ,
793
+ pub span : Span ,
794
+ }
790
795
791
796
impl fmt:: Debug for Stmt {
792
797
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
@@ -800,16 +805,19 @@ impl fmt::Debug for Stmt {
800
805
801
806
#[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash ) ]
802
807
pub enum StmtKind {
803
- /// Could be an item or a local (let) binding:
804
- Decl ( P < Decl > , NodeId ) ,
808
+ /// A local (let) binding:
809
+ Local ( P < Local > ) ,
810
+
811
+ /// An item binding
812
+ Item ( P < Item > ) ,
805
813
806
814
/// Expr without trailing semi-colon (must have unit type):
807
- Expr ( P < Expr > , NodeId ) ,
815
+ Expr ( P < Expr > ) ,
808
816
809
817
/// Expr with trailing semi-colon (may have any type):
810
- Semi ( P < Expr > , NodeId ) ,
818
+ Semi ( P < Expr > ) ,
811
819
812
- Mac ( P < Mac > , MacStmtStyle , ThinAttributes ) ,
820
+ Mac ( P < ( Mac , MacStmtStyle , ThinAttributes ) > ) ,
813
821
}
814
822
815
823
impl StmtKind {
@@ -860,16 +868,6 @@ impl Local {
860
868
}
861
869
}
862
870
863
- pub type Decl = Spanned < DeclKind > ;
864
-
865
- #[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Debug ) ]
866
- pub enum DeclKind {
867
- /// A local (let) binding:
868
- Local ( P < Local > ) ,
869
- /// An item binding:
870
- Item ( P < Item > ) ,
871
- }
872
-
873
871
impl Decl {
874
872
pub fn attrs ( & self ) -> & [ Attribute ] {
875
873
HasAttrs :: attrs ( self )
0 commit comments