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