Skip to content

Commit fcd4af1

Browse files
committed
auto merge of #5152 : catamorphism/rust/issue-3601, r=catamorphism
2 parents 6bff18e + dbbdca3 commit fcd4af1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/test/compile-fail/issue-3601.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-test
1211
struct HTMLImageData {
1312
image: Option<~str>
1413
}
@@ -25,18 +24,19 @@ enum NodeKind {
2524
Element(ElementData)
2625
}
2726

28-
enum NodeData = {
27+
struct NodeData {
2928
kind: ~NodeKind
30-
};
29+
}
3130

3231
fn main() {
3332
let mut id = HTMLImageData { image: None };
3433
let ed = ElementData { kind: ~HTMLImageElement(id) };
35-
let n = NodeData({kind : ~Element(ed)});
34+
let n = NodeData {kind : ~Element(ed)};
35+
// n.b. span could be better
3636
match n.kind {
37-
~Element(ed) => match ed.kind {
38-
~HTMLImageElement(d) if d.image.is_some() => { true }
37+
~Element(ed) => match ed.kind { //~ ERROR non-exhaustive patterns
38+
~HTMLImageElement(ref d) if d.image.is_some() => { true }
3939
},
40-
_ => fail!(~"WAT") //~ ERROR wat
40+
_ => fail!(~"WAT") //~ ERROR unreachable pattern
4141
};
4242
}

0 commit comments

Comments
 (0)