133 lines
3.7 KiB
Plaintext
133 lines
3.7 KiB
Plaintext
|
error[E0510]: cannot assign `q` in match guard
|
||
|
--> $DIR/match-guards-partially-borrow.rs:35:13
|
||
|
|
|
||
|
LL | match q {
|
||
|
| - value is immutable in match guard
|
||
|
...
|
||
|
LL | q = true; //~ ERROR
|
||
|
| ^^^^^^^^ cannot assign
|
||
|
...
|
||
|
LL | _ => (),
|
||
|
| - borrow later used here
|
||
|
|
||
|
error[E0510]: cannot assign `r` in match guard
|
||
|
--> $DIR/match-guards-partially-borrow.rs:47:13
|
||
|
|
|
||
|
LL | match r {
|
||
|
| - value is immutable in match guard
|
||
|
...
|
||
|
LL | r = true; //~ ERROR
|
||
|
| ^^^^^^^^ cannot assign
|
||
|
...
|
||
|
LL | _ => (),
|
||
|
| - borrow later used here
|
||
|
|
||
|
error[E0503]: cannot use `s` because it was mutably borrowed
|
||
|
--> $DIR/match-guards-partially-borrow.rs:56:11
|
||
|
|
|
||
|
LL | let h = &mut s;
|
||
|
| ------ borrow of `s` occurs here
|
||
|
LL | match s { //~ ERROR
|
||
|
| ^ use of borrowed `s`
|
||
|
...
|
||
|
LL | *h = !*h;
|
||
|
| -- borrow later used here
|
||
|
|
||
|
error[E0510]: cannot assign `t` in match guard
|
||
|
--> $DIR/match-guards-partially-borrow.rs:71:13
|
||
|
|
|
||
|
LL | match t {
|
||
|
| - value is immutable in match guard
|
||
|
...
|
||
|
LL | t = true; //~ ERROR
|
||
|
| ^^^^^^^^ cannot assign
|
||
|
...
|
||
|
LL | false => (),
|
||
|
| ----- borrow later used here
|
||
|
|
||
|
error[E0506]: cannot assign to `u` because it is borrowed
|
||
|
--> $DIR/match-guards-partially-borrow.rs:83:13
|
||
|
|
|
||
|
LL | match u {
|
||
|
| - borrow of `u` occurs here
|
||
|
...
|
||
|
LL | u = true; //~ ERROR
|
||
|
| ^^^^^^^^ assignment to borrowed `u` occurs here
|
||
|
...
|
||
|
LL | x => (),
|
||
|
| - borrow later used here
|
||
|
|
||
|
error[E0510]: cannot mutably borrow `x.0` in match guard
|
||
|
--> $DIR/match-guards-partially-borrow.rs:97:22
|
||
|
|
|
||
|
LL | match x {
|
||
|
| - value is immutable in match guard
|
||
|
...
|
||
|
LL | Some(ref mut r) => *r = None, //~ ERROR
|
||
|
| ^^^^^^^^^ cannot mutably borrow
|
||
|
|
||
|
error[E0506]: cannot assign to `*w.0` because it is borrowed
|
||
|
--> $DIR/match-guards-partially-borrow.rs:112:13
|
||
|
|
|
||
|
LL | match w {
|
||
|
| - borrow of `*w.0` occurs here
|
||
|
...
|
||
|
LL | *w.0 = true; //~ ERROR
|
||
|
| ^^^^^^^^^^^ assignment to borrowed `*w.0` occurs here
|
||
|
...
|
||
|
LL | x => (),
|
||
|
| - borrow later used here
|
||
|
|
||
|
error[E0510]: cannot assign `y` in match guard
|
||
|
--> $DIR/match-guards-partially-borrow.rs:123:13
|
||
|
|
|
||
|
LL | match *y {
|
||
|
| -- value is immutable in match guard
|
||
|
...
|
||
|
LL | y = &true; //~ ERROR
|
||
|
| ^^^^^^^^^ cannot assign
|
||
|
...
|
||
|
LL | false => (),
|
||
|
| ----- borrow later used here
|
||
|
|
||
|
error[E0510]: cannot assign `z` in match guard
|
||
|
--> $DIR/match-guards-partially-borrow.rs:134:13
|
||
|
|
|
||
|
LL | match z {
|
||
|
| - value is immutable in match guard
|
||
|
...
|
||
|
LL | z = &true; //~ ERROR
|
||
|
| ^^^^^^^^^ cannot assign
|
||
|
...
|
||
|
LL | &false => (),
|
||
|
| ------ borrow later used here
|
||
|
|
||
|
error[E0510]: cannot assign `a` in match guard
|
||
|
--> $DIR/match-guards-partially-borrow.rs:146:13
|
||
|
|
|
||
|
LL | match a {
|
||
|
| - value is immutable in match guard
|
||
|
...
|
||
|
LL | a = &true; //~ ERROR
|
||
|
| ^^^^^^^^^ cannot assign
|
||
|
...
|
||
|
LL | false => (),
|
||
|
| ----- borrow later used here
|
||
|
|
||
|
error[E0510]: cannot assign `b` in match guard
|
||
|
--> $DIR/match-guards-partially-borrow.rs:157:13
|
||
|
|
|
||
|
LL | match b {
|
||
|
| - value is immutable in match guard
|
||
|
...
|
||
|
LL | b = &true; //~ ERROR
|
||
|
| ^^^^^^^^^ cannot assign
|
||
|
...
|
||
|
LL | &b => (),
|
||
|
| -- borrow later used here
|
||
|
|
||
|
error: aborting due to 11 previous errors
|
||
|
|
||
|
Some errors occurred: E0503, E0506, E0510.
|
||
|
For more information about an error, try `rustc --explain E0503`.
|