1 // Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
12 struct HTMLImageData {
17 kind: Box<ElementKind>
21 HTMLImageElement(HTMLImageData)
33 let mut id = HTMLImageData { image: None };
34 let ed = ElementData { kind: box HTMLImageElement(id) };
35 let n = NodeData {kind : box Element(ed)};
36 // n.b. span could be better
38 box Element(ed) => match ed.kind { //~ ERROR non-exhaustive patterns
39 box HTMLImageElement(ref d) if d.image.is_some() => { true }
41 _ => fail!("WAT") //~ ERROR unreachable pattern