We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
https://is.gd/2ZnMND
is this 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() {}
yielding:
rustc 1.16.0 (30cf806ef 2017-03-10) error[E0301]: cannot mutably borrow in a pattern guard --> <anon>:9:15 | 9 | } else if foo.bar() {} | ^^^ borrowed mutably in pattern guard
https://is.gd/2ZnMND
is this code:
yielding: