34bf0b9e97
Fixes #3256. Fixes #3291.
14 lines
251 B
Rust
14 lines
251 B
Rust
fn foo(x: Option<~int>, b: bool) -> int {
|
|
match x {
|
|
None => { 1 }
|
|
Some(copy x) if b => { *x }
|
|
Some(_) => { 0 }
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
foo(Some(~22), true);
|
|
foo(Some(~22), false);
|
|
foo(None, true);
|
|
foo(None, false);
|
|
} |