diff options
| author | Matthew Jasper <mjjasper1@gmail.com> | 2018-07-17 20:29:48 +0100 |
|---|---|---|
| committer | Matthew Jasper <mjjasper1@gmail.com> | 2018-07-20 20:01:15 +0100 |
| commit | a06b2433fc2963dba4ef25deee6720c63ffcc03b (patch) | |
| tree | c9136001bb8d382658622906043b0d18c6ec4f12 /src/test/ui/span | |
| parent | 13b5f69848bf4ba9213fa60e7873f6ff51fc3afc (diff) | |
| download | rust-a06b2433fc2963dba4ef25deee6720c63ffcc03b.tar.gz rust-a06b2433fc2963dba4ef25deee6720c63ffcc03b.zip | |
Update tests for new NLL mutability errors
Diffstat (limited to 'src/test/ui/span')
7 files changed, 21 insertions, 21 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 3282fbba6c5..366bfc8fa20 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 @@ -1,4 +1,4 @@ -error[E0596]: cannot borrow immutable item `x` as mutable +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:63:24 | LL | fn deref_mut_field1(x: Own<Point>) { @@ -6,7 +6,7 @@ LL | fn deref_mut_field1(x: Own<Point>) { LL | let __isize = &mut x.y; //~ ERROR cannot borrow | ^ cannot borrow as mutable -error[E0596]: cannot borrow immutable item `*x` as mutable +error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:75:10 | LL | fn deref_extend_mut_field1(x: &Own<Point>) -> &mut isize { @@ -14,7 +14,7 @@ LL | fn deref_extend_mut_field1(x: &Own<Point>) -> &mut isize { LL | &mut x.y //~ ERROR cannot borrow | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable -error[E0596]: cannot borrow immutable item `x` as mutable +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:98:5 | LL | fn assign_field1<'a>(x: Own<Point>) { @@ -22,7 +22,7 @@ LL | fn assign_field1<'a>(x: Own<Point>) { LL | x.y = 3; //~ ERROR cannot borrow | ^ cannot borrow as mutable -error[E0596]: cannot borrow immutable item `*x` as mutable +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>) { @@ -30,7 +30,7 @@ LL | fn assign_field2<'a>(x: &'a Own<Point>) { LL | x.y = 3; //~ ERROR cannot borrow | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable -error[E0596]: cannot borrow immutable item `x` as mutable +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:119:5 | LL | fn deref_mut_method1(x: Own<Point>) { @@ -38,7 +38,7 @@ LL | fn deref_mut_method1(x: Own<Point>) { LL | x.set(0, 0); //~ ERROR cannot borrow | ^ cannot borrow as mutable -error[E0596]: cannot borrow immutable item `*x` as mutable +error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:131:5 | LL | fn deref_extend_mut_method1(x: &Own<Point>) -> &mut isize { @@ -46,7 +46,7 @@ LL | fn deref_extend_mut_method1(x: &Own<Point>) -> &mut isize { LL | x.y_mut() //~ ERROR cannot borrow | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable -error[E0596]: cannot borrow immutable item `x` as mutable +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:139:6 | LL | fn assign_method1<'a>(x: Own<Point>) { @@ -54,7 +54,7 @@ LL | fn assign_method1<'a>(x: Own<Point>) { LL | *x.y_mut() = 3; //~ ERROR cannot borrow | ^ cannot borrow as mutable -error[E0596]: cannot borrow immutable item `*x` as mutable +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>) { 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 0b1bfd8cee6..69bf246ff3f 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 @@ -1,4 +1,4 @@ -error[E0596]: cannot borrow immutable item `x` as mutable +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/borrowck-borrow-overloaded-deref-mut.rs:39:25 | LL | fn deref_mut1(x: Own<isize>) { @@ -6,7 +6,7 @@ LL | fn deref_mut1(x: Own<isize>) { LL | let __isize = &mut *x; //~ ERROR cannot borrow | ^ cannot borrow as mutable -error[E0596]: cannot borrow immutable item `*x` as mutable +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 { @@ -14,7 +14,7 @@ LL | fn deref_extend_mut1<'a>(x: &'a Own<isize>) -> &'a mut isize { LL | &mut **x //~ ERROR cannot borrow | ^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable -error[E0596]: cannot borrow immutable item `x` as mutable +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/borrowck-borrow-overloaded-deref-mut.rs:59:6 | LL | fn assign1<'a>(x: Own<isize>) { @@ -22,7 +22,7 @@ LL | fn assign1<'a>(x: Own<isize>) { LL | *x = 3; //~ ERROR cannot borrow | ^ cannot borrow as mutable -error[E0596]: cannot borrow immutable item `*x` as mutable +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>) { diff --git a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr index c4bdef21de4..f752015c650 100644 --- a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr +++ b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr @@ -12,7 +12,7 @@ LL | | f((Box::new(|| {}))) LL | | })); | |_______- borrow later used here -error[E0596]: cannot borrow immutable item `*f` as mutable +error[E0596]: cannot borrow `*f` as mutable, as it is behind a `&` reference --> $DIR/borrowck-call-is-borrow-issue-12224.rs:35:5 | LL | fn test2<F>(f: &F) where F: FnMut() { @@ -20,7 +20,7 @@ LL | fn test2<F>(f: &F) where F: FnMut() { LL | (*f)(); | ^^^^ `f` is a `&` reference, so the data it refers to cannot be borrowed as mutable -error[E0596]: cannot borrow immutable item `*f.f` as mutable +error[E0596]: cannot borrow `*f.f` as mutable, as it is behind a `&` reference --> $DIR/borrowck-call-is-borrow-issue-12224.rs:44:5 | LL | fn test4(f: &Test) { diff --git a/src/test/ui/span/borrowck-call-method-from-mut-aliasable.nll.stderr b/src/test/ui/span/borrowck-call-method-from-mut-aliasable.nll.stderr index 0bc614589e3..e9c0505af68 100644 --- a/src/test/ui/span/borrowck-call-method-from-mut-aliasable.nll.stderr +++ b/src/test/ui/span/borrowck-call-method-from-mut-aliasable.nll.stderr @@ -1,4 +1,4 @@ -error[E0596]: cannot borrow immutable item `*x` as mutable +error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference --> $DIR/borrowck-call-method-from-mut-aliasable.rs:27:5 | LL | fn b(x: &Foo) { diff --git a/src/test/ui/span/borrowck-fn-in-const-b.nll.stderr b/src/test/ui/span/borrowck-fn-in-const-b.nll.stderr index 1cb2c92833c..5e47d3271d4 100644 --- a/src/test/ui/span/borrowck-fn-in-const-b.nll.stderr +++ b/src/test/ui/span/borrowck-fn-in-const-b.nll.stderr @@ -1,4 +1,4 @@ -error[E0596]: cannot borrow immutable item `*x` as mutable +error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference --> $DIR/borrowck-fn-in-const-b.rs:17:9 | LL | fn broken(x: &Vec<String>) { diff --git a/src/test/ui/span/borrowck-object-mutability.nll.stderr b/src/test/ui/span/borrowck-object-mutability.nll.stderr index b318e778f87..3f0eb97c7af 100644 --- a/src/test/ui/span/borrowck-object-mutability.nll.stderr +++ b/src/test/ui/span/borrowck-object-mutability.nll.stderr @@ -1,4 +1,4 @@ -error[E0596]: cannot borrow immutable item `*x` as mutable +error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference --> $DIR/borrowck-object-mutability.rs:19:5 | LL | fn borrowed_receiver(x: &Foo) { @@ -7,7 +7,7 @@ LL | x.borrowed(); LL | x.borrowed_mut(); //~ ERROR cannot borrow | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable -error[E0596]: cannot borrow immutable item `*x` as mutable +error[E0596]: cannot borrow `*x` as mutable, as `x` is not declared as mutable --> $DIR/borrowck-object-mutability.rs:29:5 | LL | fn owned_receiver(x: Box<Foo>) { diff --git a/src/test/ui/span/mut-arg-hint.nll.stderr b/src/test/ui/span/mut-arg-hint.nll.stderr index cd19059fdae..f264ea1f916 100644 --- a/src/test/ui/span/mut-arg-hint.nll.stderr +++ b/src/test/ui/span/mut-arg-hint.nll.stderr @@ -1,4 +1,4 @@ -error[E0596]: cannot borrow immutable item `*a` as mutable +error[E0596]: cannot borrow `*a` as mutable, as it is behind a `&` reference --> $DIR/mut-arg-hint.rs:13:9 | LL | fn foo(mut a: &String) { @@ -6,7 +6,7 @@ LL | fn foo(mut a: &String) { LL | a.push_str("bar"); //~ ERROR cannot borrow immutable borrowed content | ^ `a` is a `&` reference, so the data it refers to cannot be borrowed as mutable -error[E0596]: cannot borrow immutable item `*a` as mutable +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) { @@ -14,7 +14,7 @@ LL | pub fn foo<'a>(mut a: &'a 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 -error[E0596]: cannot borrow immutable item `*a` as mutable +error[E0596]: cannot borrow `*a` as mutable, as it is behind a `&` reference --> $DIR/mut-arg-hint.rs:25:9 | LL | pub fn foo(mut a: &String) { |
