@@ -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 :: * ;
@@ -499,7 +498,6 @@ impl PartialEq for MetaItem_ {
499
498
500
499
#[ deriving( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Show ) ]
501
500
pub struct Block {
502
- pub view_items : Vec < ViewItem > ,
503
501
pub stmts : Vec < P < Stmt > > ,
504
502
pub expr : Option < P < Expr > > ,
505
503
pub id : NodeId ,
@@ -1361,14 +1359,12 @@ pub struct Mod {
1361
1359
/// For `mod foo;`, the inner span ranges from the first token
1362
1360
/// to the last token in the external file.
1363
1361
pub inner : Span ,
1364
- pub view_items : Vec < ViewItem > ,
1365
1362
pub items : Vec < P < Item > > ,
1366
1363
}
1367
1364
1368
1365
#[ deriving( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Show ) ]
1369
1366
pub struct ForeignMod {
1370
1367
pub abi : Abi ,
1371
- pub view_items : Vec < ViewItem > ,
1372
1368
pub items : Vec < P < ForeignItem > > ,
1373
1369
}
1374
1370
@@ -1427,31 +1423,13 @@ pub enum ViewPath_ {
1427
1423
/// or just
1428
1424
///
1429
1425
/// `foo::bar::baz` (with `as baz` implicitly on the right)
1430
- ViewPathSimple ( Ident , Path , NodeId ) ,
1426
+ ViewPathSimple ( Ident , Path ) ,
1431
1427
1432
1428
/// `foo::bar::*`
1433
- ViewPathGlob ( Path , NodeId ) ,
1429
+ ViewPathGlob ( Path ) ,
1434
1430
1435
1431
/// `foo::bar::{a,b,c}`
1436
- ViewPathList ( Path , Vec < PathListItem > , NodeId )
1437
- }
1438
-
1439
- #[ deriving( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Show ) ]
1440
- pub struct ViewItem {
1441
- pub node : ViewItem_ ,
1442
- pub attrs : Vec < Attribute > ,
1443
- pub vis : Visibility ,
1444
- pub span : Span ,
1445
- }
1446
-
1447
- #[ deriving( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Show ) ]
1448
- pub enum ViewItem_ {
1449
- /// Ident: name used to refer to this crate in the code
1450
- /// optional (InternedString,StrStyle): if present, this is a location
1451
- /// (containing arbitrary characters) from which to fetch the crate sources
1452
- /// For example, extern crate whatever = "github.com/rust-lang/rust"
1453
- ViewItemExternCrate ( Ident , Option < ( InternedString , StrStyle ) > , NodeId ) ,
1454
- ViewItemUse ( P < ViewPath > ) ,
1432
+ ViewPathList ( Path , Vec < PathListItem > )
1455
1433
}
1456
1434
1457
1435
/// Meta-data associated with an item
@@ -1573,6 +1551,12 @@ pub struct Item {
1573
1551
1574
1552
#[ deriving( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Show ) ]
1575
1553
pub enum Item_ {
1554
+ // Optional location (containing arbitrary characters) from which
1555
+ // to fetch the crate sources.
1556
+ // For example, extern crate whatever = "github.com/rust-lang/rust".
1557
+ ItemExternCrate ( Option < ( InternedString , StrStyle ) > ) ,
1558
+ ItemUse ( P < ViewPath > ) ,
1559
+
1576
1560
ItemStatic ( P < Ty > , Mutability , P < Expr > ) ,
1577
1561
ItemConst ( P < Ty > , P < Expr > ) ,
1578
1562
ItemFn ( P < FnDecl > , Unsafety , Abi , Generics , P < Block > ) ,
@@ -1598,6 +1582,8 @@ pub enum Item_ {
1598
1582
impl Item_ {
1599
1583
pub fn descriptive_variant ( & self ) -> & str {
1600
1584
match * self {
1585
+ ItemExternCrate ( ..) => "extern crate" ,
1586
+ ItemUse ( ..) => "use" ,
1601
1587
ItemStatic ( ..) => "static item" ,
1602
1588
ItemConst ( ..) => "constant item" ,
1603
1589
ItemFn ( ..) => "function" ,
@@ -1674,7 +1660,6 @@ mod test {
1674
1660
hi : BytePos ( 19 ) ,
1675
1661
expn_id : NO_EXPANSION ,
1676
1662
} ,
1677
- view_items : Vec :: new ( ) ,
1678
1663
items : Vec :: new ( ) ,
1679
1664
} ,
1680
1665
attrs : Vec :: new ( ) ,
0 commit comments