2019-11-04 00:00:00 +00:00
|
|
|
// check-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(dead_code)]
|
2017-04-15 10:14:09 +05:30
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
impl Foo {
|
|
|
|
fn bar(&mut self) -> bool { true }
|
|
|
|
}
|
|
|
|
|
2017-04-15 17:21:53 +05:30
|
|
|
fn error(foo: &mut Foo) {
|
2017-04-15 10:14:09 +05:30
|
|
|
if let Some(_) = Some(true) {
|
|
|
|
} else if foo.bar() {}
|
|
|
|
}
|
|
|
|
|
2017-04-15 17:21:53 +05:30
|
|
|
fn ok(foo: &mut Foo) {
|
|
|
|
if let Some(_) = Some(true) {
|
|
|
|
} else {
|
|
|
|
if foo.bar() {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-15 10:14:09 +05:30
|
|
|
fn main() {}
|