Skip to content

Instantly share code, notes, and snippets.

@pnkfelix
Created June 5, 2018 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pnkfelix/c766479dea9706660f8f5dba22dacabd to your computer and use it in GitHub Desktop.
Save pnkfelix/c766479dea9706660f8f5dba22dacabd to your computer and use it in GitHub Desktop.
--- 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