blob: 541789b7f17e4a902f80981478cd38490a597f7d [file] [log] [blame] [edit]
error[E0506]: cannot assign to `self.status` because it is borrowed
--> $DIR/nll-problem-case-3-issue-123839.rs:37:9
|
LL | fn foo(self: &mut Self) -> Result<(), &str> {
| - let's call the lifetime of this reference `'1`
LL | self.bar()?; // rust reports this line conflicts with the next line
| -----------
| |
| `self.status` is borrowed here
| returning this value requires that `*self` is borrowed for `'1`
LL | self.status = 1; // and this line is the victim
| ^^^^^^^^^^^^^^^ `self.status` is assigned to here but it was already borrowed
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0506`.