rust/tests/ui/issues/issue-41272.rs

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

22 lines
307 B
Rust
Raw Normal View History

// check-pass
#![allow(dead_code)]
struct Foo;
impl Foo {
fn bar(&mut self) -> bool { true }
}
2017-04-15 11:51:53 +00:00
fn error(foo: &mut Foo) {
if let Some(_) = Some(true) {
} else if foo.bar() {}
}
2017-04-15 11:51:53 +00:00
fn ok(foo: &mut Foo) {
if let Some(_) = Some(true) {
} else {
if foo.bar() {}
}
}
fn main() {}