rust/tests/ui/binding/match-struct-0.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
303 B
Rust
Raw Normal View History

// run-pass
struct Foo{
f : isize,
}
pub fn main() {
let f = Foo{f: 1};
match f {
Foo{f: 0} => panic!(),
2013-11-28 20:22:53 +00:00
Foo{..} => (),
}
match f {
Foo{f: 0} => panic!(),
Foo{f: _f} => (),
}
match f {
Foo{f: 0} => panic!(),
_ => (),
}
}