@@ -53,7 +53,6 @@ pub use self::UnboxedClosureKind::*;
53
53
pub use self :: UnOp :: * ;
54
54
pub use self :: UnsafeSource :: * ;
55
55
pub use self :: VariantKind :: * ;
56
- pub use self :: ViewItem_ :: * ;
57
56
pub use self :: ViewPath_ :: * ;
58
57
pub use self :: Visibility :: * ;
59
58
pub use self :: PathParameters :: * ;
@@ -511,7 +510,6 @@ impl PartialEq for MetaItem_ {
511
510
512
511
#[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Show ) ]
513
512
pub struct Block {
514
- pub view_items : Vec < ViewItem > ,
515
513
pub stmts : Vec < P < Stmt > > ,
516
514
pub expr : Option < P < Expr > > ,
517
515
pub id : NodeId ,
@@ -1452,14 +1450,12 @@ pub struct Mod {
1452
1450
/// For `mod foo;`, the inner span ranges from the first token
1453
1451
/// to the last token in the external file.
1454
1452
pub inner : Span ,
1455
- pub view_items : Vec < ViewItem > ,
1456
1453
pub items : Vec < P < Item > > ,
1457
1454
}
1458
1455
1459
1456
#[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Show ) ]
1460
1457
pub struct ForeignMod {
1461
1458
pub abi : Abi ,
1462
- pub view_items : Vec < ViewItem > ,
1463
1459
pub items : Vec < P < ForeignItem > > ,
1464
1460
}
1465
1461
@@ -1518,44 +1514,13 @@ pub enum ViewPath_ {
1518
1514
/// or just
1519
1515
///
1520
1516
/// `foo::bar::baz` (with `as baz` implicitly on the right)
1521
- ViewPathSimple ( Ident , Path , NodeId ) ,
1517
+ ViewPathSimple ( Ident , Path ) ,
1522
1518
1523
1519
/// `foo::bar::*`
1524
- ViewPathGlob ( Path , NodeId ) ,
1520
+ ViewPathGlob ( Path ) ,
1525
1521
1526
1522
/// `foo::bar::{a,b,c}`
1527
- ViewPathList ( Path , Vec < PathListItem > , NodeId )
1528
- }
1529
-
1530
- #[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Show ) ]
1531
- pub struct ViewItem {
1532
- pub node : ViewItem_ ,
1533
- pub attrs : Vec < Attribute > ,
1534
- pub vis : Visibility ,
1535
- pub span : Span ,
1536
- }
1537
-
1538
- impl ViewItem {
1539
- pub fn id ( & self ) -> NodeId {
1540
- match self . node {
1541
- ViewItemExternCrate ( _, _, id) => id,
1542
- ViewItemUse ( ref vp) => match vp. node {
1543
- ViewPathSimple ( _, _, id) => id,
1544
- ViewPathGlob ( _, id) => id,
1545
- ViewPathList ( _, _, id) => id,
1546
- }
1547
- }
1548
- }
1549
- }
1550
-
1551
- #[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Show ) ]
1552
- pub enum ViewItem_ {
1553
- /// Ident: name used to refer to this crate in the code
1554
- /// optional (InternedString,StrStyle): if present, this is a location
1555
- /// (containing arbitrary characters) from which to fetch the crate sources
1556
- /// For example, extern crate whatever = "github.com/rust-lang/rust"
1557
- ViewItemExternCrate ( Ident , Option < ( InternedString , StrStyle ) > , NodeId ) ,
1558
- ViewItemUse ( P < ViewPath > ) ,
1523
+ ViewPathList ( Path , Vec < PathListItem > )
1559
1524
}
1560
1525
1561
1526
/// Meta-data associated with an item
@@ -1677,6 +1642,12 @@ pub struct Item {
1677
1642
1678
1643
#[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Show ) ]
1679
1644
pub enum Item_ {
1645
+ // Optional location (containing arbitrary characters) from which
1646
+ // to fetch the crate sources.
1647
+ // For example, extern crate whatever = "github.com/rust-lang/rust".
1648
+ ItemExternCrate ( Option < ( InternedString , StrStyle ) > ) ,
1649
+ ItemUse ( P < ViewPath > ) ,
1650
+
1680
1651
ItemStatic ( P < Ty > , Mutability , P < Expr > ) ,
1681
1652
ItemConst ( P < Ty > , P < Expr > ) ,
1682
1653
ItemFn ( P < FnDecl > , Unsafety , Abi , Generics , P < Block > ) ,
@@ -1703,6 +1674,8 @@ pub enum Item_ {
1703
1674
impl Item_ {
1704
1675
pub fn descriptive_variant ( & self ) -> & str {
1705
1676
match * self {
1677
+ ItemExternCrate ( ..) => "extern crate" ,
1678
+ ItemUse ( ..) => "use" ,
1706
1679
ItemStatic ( ..) => "static item" ,
1707
1680
ItemConst ( ..) => "constant item" ,
1708
1681
ItemFn ( ..) => "function" ,
0 commit comments