Created
June 5, 2018 12:34
-
-
Save pnkfelix/c766479dea9706660f8f5dba22dacabd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- issue-38147-1.stderr 2018-05-30 14:47:45.876944584 +0200 | |
+++ issue-38147-1.nll.stderr 2018-06-04 12:18:36.039563618 +0200 | |
@@ -1,11 +1,13 @@ | |
-error[E0389]: cannot borrow data mutably in a `&` reference | |
+error[E0596]: cannot borrow immutable item `*self.s` as mutable | |
--> $DIR/issue-38147-1.rs:27:9 | |
| | |
LL | fn f(&self) { | |
- | ----- use `&mut self` here to make mutable | |
+ | ----- help: consider changing this to be a mutable reference: `&mut self` | |
LL | self.s.push('x'); //~ ERROR cannot borrow data mutably | |
- | ^^^^^^ assignment into an immutable reference | |
+ | ^^^^^^ cannot borrow as mutable | |
+ | | |
+ = note: the value which is causing this path not to be mutable is...: `*self` | |
error: aborting due to previous error | |
-For more information about this error, try `rustc --explain E0389`. | |
+For more information about this error, try `rustc --explain E0596`. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment