@@ -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 ,
@@ -1445,14 +1443,12 @@ pub struct Mod {
1445
1443
/// For `mod foo;`, the inner span ranges from the first token
1446
1444
/// to the last token in the external file.
1447
1445
pub inner : Span ,
1448
- pub view_items : Vec < ViewItem > ,
1449
1446
pub items : Vec < P < Item > > ,
1450
1447
}
1451
1448
1452
1449
#[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Show ) ]
1453
1450
pub struct ForeignMod {
1454
1451
pub abi : Abi ,
1455
- pub view_items : Vec < ViewItem > ,
1456
1452
pub items : Vec < P < ForeignItem > > ,
1457
1453
}
1458
1454
@@ -1511,44 +1507,13 @@ pub enum ViewPath_ {
1511
1507
/// or just
1512
1508
///
1513
1509
/// `foo::bar::baz` (with `as baz` implicitly on the right)
1514
- ViewPathSimple ( Ident , Path , NodeId ) ,
1510
+ ViewPathSimple ( Ident , Path ) ,
1515
1511
1516
1512
/// `foo::bar::*`
1517
- ViewPathGlob ( Path , NodeId ) ,
1513
+ ViewPathGlob ( Path ) ,
1518
1514
1519
1515
/// `foo::bar::{a,b,c}`
1520
- ViewPathList ( Path , Vec < PathListItem > , NodeId )
1521
- }
1522
-
1523
- #[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Show ) ]
1524
- pub struct ViewItem {
1525
- pub node : ViewItem_ ,
1526
- pub attrs : Vec < Attribute > ,
1527
- pub vis : Visibility ,
1528
- pub span : Span ,
1529
- }
1530
-
1531
- impl ViewItem {
1532
- pub fn id ( & self ) -> NodeId {
1533
- match self . node {
1534
- ViewItemExternCrate ( _, _, id) => id,
1535
- ViewItemUse ( ref vp) => match vp. node {
1536
- ViewPathSimple ( _, _, id) => id,
1537
- ViewPathGlob ( _, id) => id,
1538
- ViewPathList ( _, _, id) => id,
1539
- }
1540
- }
1541
- }
1542
- }
1543
-
1544
- #[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Show ) ]
1545
- pub enum ViewItem_ {
1546
- /// Ident: name used to refer to this crate in the code
1547
- /// optional (InternedString,StrStyle): if present, this is a location
1548
- /// (containing arbitrary characters) from which to fetch the crate sources
1549
- /// For example, extern crate whatever = "github.com/rust-lang/rust"
1550
- ViewItemExternCrate ( Ident , Option < ( InternedString , StrStyle ) > , NodeId ) ,
1551
- ViewItemUse ( P < ViewPath > ) ,
1516
+ ViewPathList ( Path , Vec < PathListItem > )
1552
1517
}
1553
1518
1554
1519
/// Meta-data associated with an item
@@ -1670,6 +1635,12 @@ pub struct Item {
1670
1635
1671
1636
#[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Show ) ]
1672
1637
pub enum Item_ {
1638
+ // Optional location (containing arbitrary characters) from which
1639
+ // to fetch the crate sources.
1640
+ // For example, extern crate whatever = "github.com/rust-lang/rust".
1641
+ ItemExternCrate ( Option < ( InternedString , StrStyle ) > ) ,
1642
+ ItemUse ( P < ViewPath > ) ,
1643
+
1673
1644
ItemStatic ( P < Ty > , Mutability , P < Expr > ) ,
1674
1645
ItemConst ( P < Ty > , P < Expr > ) ,
1675
1646
ItemFn ( P < FnDecl > , Unsafety , Abi , Generics , P < Block > ) ,
@@ -1696,6 +1667,8 @@ pub enum Item_ {
1696
1667
impl Item_ {
1697
1668
pub fn descriptive_variant ( & self ) -> & str {
1698
1669
match * self {
1670
+ ItemExternCrate ( ..) => "extern crate" ,
1671
+ ItemUse ( ..) => "use" ,
1699
1672
ItemStatic ( ..) => "static item" ,
1700
1673
ItemConst ( ..) => "constant item" ,
1701
1674
ItemFn ( ..) => "function" ,
0 commit comments