diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2018-07-30 15:41:39 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2018-07-30 15:41:39 -0700 |
| commit | c883edfbc6b669bea4264f5a79e2bee0e5766c38 (patch) | |
| tree | 37fd644b15542b1910e213ecdd473d99c28c214f /src/test/ui/span | |
| parent | 70cac59031d5c33962a1f53cdca9359c0dcd1f9f (diff) | |
| download | rust-c883edfbc6b669bea4264f5a79e2bee0e5766c38.tar.gz rust-c883edfbc6b669bea4264f5a79e2bee0e5766c38.zip | |
Include lifetime in mutability suggestion in NLL messages
Diffstat (limited to 'src/test/ui/span')
3 files changed, 5 insertions, 5 deletions
diff --git a/src/test/ui/span/borrowck-borrow-overloaded-auto-deref-mut.nll.stderr b/src/test/ui/span/borrowck-borrow-overloaded-auto-deref-mut.nll.stderr index 366bfc8fa20..4a693a3b05d 100644 --- a/src/test/ui/span/borrowck-borrow-overloaded-auto-deref-mut.nll.stderr +++ b/src/test/ui/span/borrowck-borrow-overloaded-auto-deref-mut.nll.stderr @@ -26,7 +26,7 @@ error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:102:5 | LL | fn assign_field2<'a>(x: &'a Own<Point>) { - | -------------- help: consider changing this to be a mutable reference: `&mut Own<Point>` + | -------------- help: consider changing this to be a mutable reference: `&'a mut Own<Point>` LL | x.y = 3; //~ ERROR cannot borrow | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable @@ -58,7 +58,7 @@ error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:143:6 | LL | fn assign_method2<'a>(x: &'a Own<Point>) { - | -------------- help: consider changing this to be a mutable reference: `&mut Own<Point>` + | -------------- help: consider changing this to be a mutable reference: `&'a mut Own<Point>` LL | *x.y_mut() = 3; //~ ERROR cannot borrow | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable diff --git a/src/test/ui/span/borrowck-borrow-overloaded-deref-mut.nll.stderr b/src/test/ui/span/borrowck-borrow-overloaded-deref-mut.nll.stderr index 69bf246ff3f..44a5062cb4d 100644 --- a/src/test/ui/span/borrowck-borrow-overloaded-deref-mut.nll.stderr +++ b/src/test/ui/span/borrowck-borrow-overloaded-deref-mut.nll.stderr @@ -10,7 +10,7 @@ error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference --> $DIR/borrowck-borrow-overloaded-deref-mut.rs:51:11 | LL | fn deref_extend_mut1<'a>(x: &'a Own<isize>) -> &'a mut isize { - | -------------- help: consider changing this to be a mutable reference: `&mut Own<isize>` + | -------------- help: consider changing this to be a mutable reference: `&'a mut Own<isize>` LL | &mut **x //~ ERROR cannot borrow | ^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable @@ -26,7 +26,7 @@ error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference --> $DIR/borrowck-borrow-overloaded-deref-mut.rs:63:6 | LL | fn assign2<'a>(x: &'a Own<isize>) { - | -------------- help: consider changing this to be a mutable reference: `&mut Own<isize>` + | -------------- help: consider changing this to be a mutable reference: `&'a mut Own<isize>` LL | **x = 3; //~ ERROR cannot borrow | ^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable diff --git a/src/test/ui/span/mut-arg-hint.nll.stderr b/src/test/ui/span/mut-arg-hint.nll.stderr index f264ea1f916..f42cf6500e2 100644 --- a/src/test/ui/span/mut-arg-hint.nll.stderr +++ b/src/test/ui/span/mut-arg-hint.nll.stderr @@ -10,7 +10,7 @@ error[E0596]: cannot borrow `*a` as mutable, as it is behind a `&` reference --> $DIR/mut-arg-hint.rs:18:5 | LL | pub fn foo<'a>(mut a: &'a String) { - | ---------- help: consider changing this to be a mutable reference: `&mut std::string::String` + | ---------- help: consider changing this to be a mutable reference: `&'a mut String` LL | a.push_str("foo"); //~ ERROR cannot borrow immutable borrowed content | ^ `a` is a `&` reference, so the data it refers to cannot be borrowed as mutable |
