From a06b2433fc2963dba4ef25deee6720c63ffcc03b Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Tue, 17 Jul 2018 20:29:48 +0100 Subject: Update tests for new NLL mutability errors --- .../borrowck-borrow-overloaded-auto-deref-mut.nll.stderr | 16 ++++++++-------- .../span/borrowck-borrow-overloaded-deref-mut.nll.stderr | 8 ++++---- .../span/borrowck-call-is-borrow-issue-12224.nll.stderr | 4 ++-- .../borrowck-call-method-from-mut-aliasable.nll.stderr | 2 +- src/test/ui/span/borrowck-fn-in-const-b.nll.stderr | 2 +- src/test/ui/span/borrowck-object-mutability.nll.stderr | 4 ++-- src/test/ui/span/mut-arg-hint.nll.stderr | 6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) (limited to 'src/test/ui/span') 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) { @@ -6,7 +6,7 @@ LL | fn deref_mut_field1(x: Own) { 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) -> &mut isize { @@ -14,7 +14,7 @@ LL | fn deref_extend_mut_field1(x: &Own) -> &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) { @@ -22,7 +22,7 @@ LL | fn assign_field1<'a>(x: Own) { 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) { @@ -30,7 +30,7 @@ LL | fn assign_field2<'a>(x: &'a Own) { 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) { @@ -38,7 +38,7 @@ LL | fn deref_mut_method1(x: Own) { 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) -> &mut isize { @@ -46,7 +46,7 @@ LL | fn deref_extend_mut_method1(x: &Own) -> &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) { @@ -54,7 +54,7 @@ LL | fn assign_method1<'a>(x: Own) { 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) { 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) { @@ -6,7 +6,7 @@ LL | fn deref_mut1(x: Own) { 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) -> &'a mut isize { @@ -14,7 +14,7 @@ LL | fn deref_extend_mut1<'a>(x: &'a Own) -> &'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) { @@ -22,7 +22,7 @@ LL | fn assign1<'a>(x: Own) { 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) { 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) where F: FnMut() { @@ -20,7 +20,7 @@ LL | fn test2(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) { 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) { 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) { -- cgit 1.4.1-3-g733a5