Update NLL tests
This commit is contained in:
@@ -5,7 +5,7 @@ LL | while let Some(Ok(string)) = foo.get() {
|
||||
| --- immutable borrow occurs here
|
||||
LL | foo.mutate();
|
||||
| ^^^^^^^^^^^^ mutable borrow occurs here
|
||||
LL | //~^ ERROR cannot borrow `foo` as mutable
|
||||
LL |
|
||||
LL | println!("foo={:?}", *string);
|
||||
| ------- immutable borrow later used here
|
||||
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
error[E0594]: cannot assign to `*x` which is behind a `&` reference
|
||||
--> $DIR/enum.rs:9:5
|
||||
|
|
||||
LL | *x += 1; //~ ERROR cannot assign to immutable
|
||||
LL | *x += 1;
|
||||
| ^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be written
|
||||
|
||||
error[E0594]: cannot assign to `*x` which is behind a `&` reference
|
||||
--> $DIR/enum.rs:13:9
|
||||
|
|
||||
LL | *x += 1; //~ ERROR cannot assign to immutable
|
||||
LL | *x += 1;
|
||||
| ^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be written
|
||||
|
||||
error[E0594]: cannot assign to `*x` which is behind a `&` reference
|
||||
--> $DIR/enum.rs:19:9
|
||||
|
|
||||
LL | *x += 1; //~ ERROR cannot assign to immutable
|
||||
LL | *x += 1;
|
||||
| ^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be written
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
error[E0594]: cannot assign to `*n` which is behind a `&` reference
|
||||
--> $DIR/explicit-mut.rs:7:13
|
||||
|
|
||||
LL | *n += 1; //~ ERROR cannot assign to immutable
|
||||
LL | *n += 1;
|
||||
| ^^^^^^^ `n` is a `&` reference, so the data it refers to cannot be written
|
||||
|
||||
error[E0594]: cannot assign to `*n` which is behind a `&` reference
|
||||
--> $DIR/explicit-mut.rs:15:13
|
||||
|
|
||||
LL | *n += 1; //~ ERROR cannot assign to immutable
|
||||
LL | *n += 1;
|
||||
| ^^^^^^^ `n` is a `&` reference, so the data it refers to cannot be written
|
||||
|
||||
error[E0594]: cannot assign to `*n` which is behind a `&` reference
|
||||
--> $DIR/explicit-mut.rs:23:13
|
||||
|
|
||||
LL | *n += 1; //~ ERROR cannot assign to immutable
|
||||
LL | *n += 1;
|
||||
| ^^^^^^^ `n` is a `&` reference, so the data it refers to cannot be written
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
Reference in New Issue
Block a user