Skip to content

Commit 938187c

Browse files
committed
---
yaml --- r: 174826 b: refs/heads/snap-stage3 c: 38ac9e3 h: refs/heads/master v: v3
1 parent 14db4f1 commit 938187c

File tree

3 files changed

+131
-354
lines changed

3 files changed

+131
-354
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: a0f86de49748b472d4d189d9688b0d856c000914
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 53edd767b42d81efc64a018ad93efc2bf1e37f4b
4+
refs/heads/snap-stage3: 38ac9e3984392ab11e33b77d5e1927c1fa17fb07
55
refs/heads/try: 08f6380a9f0b866796080094f44fe25ea5636547
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/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,
@@ -1452,14 +1450,12 @@ pub struct Mod {
14521450
/// For `mod foo;`, the inner span ranges from the first token
14531451
/// to the last token in the external file.
14541452
pub inner: Span,
1455-
pub view_items: Vec<ViewItem>,
14561453
pub items: Vec<P<Item>>,
14571454
}
14581455

14591456
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
14601457
pub struct ForeignMod {
14611458
pub abi: Abi,
1462-
pub view_items: Vec<ViewItem>,
14631459
pub items: Vec<P<ForeignItem>>,
14641460
}
14651461

@@ -1518,44 +1514,13 @@ pub enum ViewPath_ {
15181514
/// or just
15191515
///
15201516
/// `foo::bar::baz` (with `as baz` implicitly on the right)
1521-
ViewPathSimple(Ident, Path, NodeId),
1517+
ViewPathSimple(Ident, Path),
15221518

15231519
/// `foo::bar::*`
1524-
ViewPathGlob(Path, NodeId),
1520+
ViewPathGlob(Path),
15251521

15261522
/// `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>)
15591524
}
15601525

15611526
/// Meta-data associated with an item
@@ -1677,6 +1642,12 @@ pub struct Item {
16771642

16781643
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Show)]
16791644
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+
16801651
ItemStatic(P<Ty>, Mutability, P<Expr>),
16811652
ItemConst(P<Ty>, P<Expr>),
16821653
ItemFn(P<FnDecl>, Unsafety, Abi, Generics, P<Block>),
@@ -1703,6 +1674,8 @@ pub enum Item_ {
17031674
impl Item_ {
17041675
pub fn descriptive_variant(&self) -> &str {
17051676
match *self {
1677+
ItemExternCrate(..) => "extern crate",
1678+
ItemUse(..) => "use",
17061679
ItemStatic(..) => "static item",
17071680
ItemConst(..) => "constant item",
17081681
ItemFn(..) => "function",

0 commit comments

Comments
 (0)