18 lines
360 B
Rust
18 lines
360 B
Rust
|
|
|
|
// a bug was causing this to complain about leaked memory on exit
|
|
use std;
|
|
use option::Some;
|
|
use option::None;
|
|
|
|
enum t { foo(int, uint), bar(int, Option<int>), }
|
|
|
|
fn nested(o: t) {
|
|
match o {
|
|
bar(i, Some::<int>(_)) => { error!("wrong pattern matched"); fail; }
|
|
_ => { error!("succeeded"); }
|
|
}
|
|
}
|
|
|
|
fn main() { nested(bar(1, None::<int>)); }
|