blob: fd6fa7632d5d4dd95f0075527ae5b463f8fddada [file] [log] [blame]
error[E0499]: cannot borrow `*x` as mutable more than once at a time
--> $DIR/nll-problem-case-3-issue-54663.rs:20:9
|
LL | fn foo(x: &mut u8) -> Option<&u8> {
| - let's call the lifetime of this reference `'1`
LL | if let Some(y) = bar(x) {
| - first mutable borrow occurs here
LL | return Some(y);
| ------- returning this value requires that `*x` is borrowed for `'1`
LL | }
LL | bar(x)
| ^ second mutable borrow occurs here
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0499`.