Skip to content

Commit 1deb57a

Browse files
committed
---
yaml --- r: 88644 b: refs/heads/snap-stage3 c: 7b42497 h: refs/heads/master v: v3
1 parent 43f233d commit 1deb57a

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
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: deeca5d586bfaa4aa60246f671a8d611d38f6248
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: e3b168dab34b7fc765aebda301e4a0aeaf556f67
4+
refs/heads/snap-stage3: 7b424974531b0ade62e6a26cce038abf5dac0723
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/dead.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ impl MarkSymbolVisitor {
107107
match item.node {
108108
ast::item_fn(..)
109109
| ast::item_ty(..)
110+
| ast::item_enum(..)
111+
| ast::item_struct(..)
110112
| ast::item_static(..) => {
111113
visit::walk_item(self, item, ());
112114
}

branches/snap-stage3/src/libsyntax/visit.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ pub fn walk_variant<E:Clone, V:Visitor<E>>(visitor:&mut V,
290290
env.clone())
291291
}
292292
}
293+
match variant.node.disr_expr {
294+
Some(expr) => visitor.visit_expr(expr, env),
295+
None => ()
296+
}
293297
}
294298

295299
pub fn skip_ty<E, V:Visitor<E>>(_: &mut V, _: &Ty, _: E) {

branches/snap-stage3/src/test/compile-fail/lint-dead-code-1.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ static priv_static: int = 0; //~ ERROR: code is never used
2727
static used_static: int = 0;
2828
pub static used_static2: int = used_static;
2929
static USED_STATIC: int = 0;
30+
static STATIC_USED_IN_ENUM_DISCRIMINANT: uint = 10;
3031

3132
pub type typ = ~UsedStruct4;
3233
pub struct PubStruct();
@@ -41,8 +42,15 @@ struct SemiUsedStruct;
4142
impl SemiUsedStruct {
4243
fn la_la_la() {}
4344
}
45+
struct StructUsedAsField;
46+
struct StructUsedInEnum;
47+
pub struct PubStruct2 {
48+
struct_used_as_field: *StructUsedAsField
49+
}
4450

4551
pub enum pub_enum { foo1, bar1 }
52+
pub enum pub_enum2 { a(~StructUsedInEnum) }
53+
pub enum pub_enum3 { Foo = STATIC_USED_IN_ENUM_DISCRIMINANT }
4654
enum priv_enum { foo2, bar2 } //~ ERROR: code is never used
4755
enum used_enum { foo3, bar3 }
4856

0 commit comments

Comments
 (0)