File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
- // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1
+ // Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
2
2
// file at the top-level directory of this distribution and at
3
3
// http://rust-lang.org/COPYRIGHT.
4
4
//
8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- // xfail-test
12
11
struct HTMLImageData {
13
12
image : Option < ~str >
14
13
}
@@ -25,18 +24,19 @@ enum NodeKind {
25
24
Element ( ElementData )
26
25
}
27
26
28
- enum NodeData = {
27
+ struct NodeData {
29
28
kind : ~NodeKind
30
- } ;
29
+ }
31
30
32
31
fn main ( ) {
33
32
let mut id = HTMLImageData { image : None } ;
34
33
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
36
36
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 }
39
39
} ,
40
- _ => fail ! ( ~"WAT ") //~ ERROR wat
40
+ _ => fail ! ( ~"WAT ") //~ ERROR unreachable pattern
41
41
} ;
42
42
}
You can’t perform that action at this time.
0 commit comments