diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-41272.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-41272.rs b/src/test/ui/issues/issue-41272.rs new file mode 100644 index 000000000..1f4da46f8 --- /dev/null +++ b/src/test/ui/issues/issue-41272.rs @@ -0,0 +1,21 @@ +// check-pass +#![allow(dead_code)] +struct Foo; + +impl Foo { + fn bar(&mut self) -> bool { true } +} + +fn error(foo: &mut Foo) { + if let Some(_) = Some(true) { + } else if foo.bar() {} +} + +fn ok(foo: &mut Foo) { + if let Some(_) = Some(true) { + } else { + if foo.bar() {} + } +} + +fn main() {} |