Skip to content

Commit e584cf7

Browse files
committed
---
yaml --- r: 172873 b: refs/heads/try c: fdfaabb h: refs/heads/master i: 172871: 14ec49b v: v3
1 parent 456b5c6 commit e584cf7

File tree

3 files changed

+132
-357
lines changed

3 files changed

+132
-357
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 170c4399e614fe599c3d41306b3429ca8b3b68c6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 5b3cd3900ceda838f5798c30ab96ceb41f962534
5-
refs/heads/try: b016fee76a88dbed6b1797256cef80085f12e25f
5+
refs/heads/try: fdfaabbfae7f790cc11d73e4b8d9312a31f57ba7
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libsyntax/ast.rs

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ pub use self::UnboxedClosureKind::*;
5353
pub use self::UnOp::*;
5454
pub use self::UnsafeSource::*;
5555
pub use self::VariantKind::*;
56-
pub use self::ViewItem_::*;
5756
pub use self::ViewPath_::*;
5857
pub use self::Visibility::*;
5958
pub use self::PathParameters::*;
@@ -511,7 +510,6 @@ impl PartialEq for MetaItem_ {
511510

512511
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
513512
pub struct Block {
514-
pub view_items: Vec<ViewItem>,
515513
pub stmts: Vec<P<Stmt>>,
516514
pub expr: Option<P<Expr>>,
517515
pub id: NodeId,
@@ -1445,14 +1443,12 @@ pub struct Mod {
14451443
/// For `mod foo;`, the inner span ranges from the first token
14461444
/// to the last token in the external file.
14471445
pub inner: Span,
1448-
pub view_items: Vec<ViewItem>,
14491446
pub items: Vec<P<Item>>,
14501447
}
14511448

14521449
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
14531450
pub struct ForeignMod {
14541451
pub abi: Abi,
1455-
pub view_items: Vec<ViewItem>,
14561452
pub items: Vec<P<ForeignItem>>,
14571453
}
14581454

@@ -1511,44 +1507,13 @@ pub enum ViewPath_ {
15111507
/// or just
15121508
///
15131509
/// `foo::bar::baz` (with `as baz` implicitly on the right)
1514-
ViewPathSimple(Ident, Path, NodeId),
1510+
ViewPathSimple(Ident, Path),
15151511

15161512
/// `foo::bar::*`
1517-
ViewPathGlob(Path, NodeId),
1513+
ViewPathGlob(Path),
15181514

15191515
/// `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>)
15521517
}
15531518

15541519
/// Meta-data associated with an item
@@ -1670,6 +1635,12 @@ pub struct Item {
16701635

16711636
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
16721637
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+
16731644
ItemStatic(P<Ty>, Mutability, P<Expr>),
16741645
ItemConst(P<Ty>, P<Expr>),
16751646
ItemFn(P<FnDecl>, Unsafety, Abi, Generics, P<Block>),
@@ -1696,6 +1667,8 @@ pub enum Item_ {
16961667
impl Item_ {
16971668
pub fn descriptive_variant(&self) -> &str {
16981669
match *self {
1670+
ItemExternCrate(..) => "extern crate",
1671+
ItemUse(..) => "use",
16991672
ItemStatic(..) => "static item",
17001673
ItemConst(..) => "constant item",
17011674
ItemFn(..) => "function",

0 commit comments

Comments
 (0)