2018-09-13 16:04:00 -05:00
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
2019-02-02 04:45:20 -06:00
|
|
|
LL | false
|
|
|
|
LL | } => (),
|
2018-09-13 16:04:00 -05:00
|
|
|
| - 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
|
2019-02-02 04:45:20 -06:00
|
|
|
LL | false
|
|
|
|
LL | } => (),
|
|
|
|
| - borrow later used here
|
|
|
|
|
|
|
|
error[E0506]: cannot assign to `t` because it is borrowed
|
|
|
|
--> $DIR/match-guards-partially-borrow.rs:122:13
|
|
|
|
|
|
|
|
|
LL | match t {
|
|
|
|
| - borrow of `t` occurs here
|
|
|
|
LL | s if {
|
|
|
|
LL | t = !t; //~ ERROR
|
|
|
|
| ^^^^^^ assignment to borrowed `t` occurs here
|
|
|
|
LL | false
|
|
|
|
LL | } => (), // What value should `s` have in the arm?
|
2018-09-13 16:04:00 -05:00
|
|
|
| - borrow later used here
|
|
|
|
|
|
|
|
error[E0510]: cannot assign `y` in match guard
|
2019-02-02 04:45:20 -06:00
|
|
|
--> $DIR/match-guards-partially-borrow.rs:133:13
|
2018-09-13 16:04:00 -05:00
|
|
|
|
|
|
|
|
LL | match *y {
|
|
|
|
| -- value is immutable in match guard
|
|
|
|
...
|
|
|
|
LL | y = &true; //~ ERROR
|
|
|
|
| ^^^^^^^^^ cannot assign
|
|
|
|
|
|
|
|
error[E0510]: cannot assign `z` in match guard
|
2019-02-02 04:45:20 -06:00
|
|
|
--> $DIR/match-guards-partially-borrow.rs:144:13
|
2018-09-13 16:04:00 -05:00
|
|
|
|
|
|
|
|
LL | match z {
|
|
|
|
| - value is immutable in match guard
|
|
|
|
...
|
|
|
|
LL | z = &true; //~ ERROR
|
|
|
|
| ^^^^^^^^^ cannot assign
|
|
|
|
|
|
|
|
error[E0510]: cannot assign `a` in match guard
|
2019-02-02 04:45:20 -06:00
|
|
|
--> $DIR/match-guards-partially-borrow.rs:156:13
|
2018-09-13 16:04:00 -05:00
|
|
|
|
|
|
|
|
LL | match a {
|
|
|
|
| - value is immutable in match guard
|
|
|
|
...
|
|
|
|
LL | a = &true; //~ ERROR
|
|
|
|
| ^^^^^^^^^ cannot assign
|
|
|
|
|
|
|
|
error[E0510]: cannot assign `b` in match guard
|
2019-02-02 04:45:20 -06:00
|
|
|
--> $DIR/match-guards-partially-borrow.rs:167:13
|
2018-09-13 16:04:00 -05:00
|
|
|
|
|
|
|
|
LL | match b {
|
|
|
|
| - value is immutable in match guard
|
|
|
|
...
|
|
|
|
LL | b = &true; //~ ERROR
|
|
|
|
| ^^^^^^^^^ cannot assign
|
|
|
|
|
2019-02-02 04:45:20 -06:00
|
|
|
error: aborting due to 12 previous errors
|
2018-09-13 16:04:00 -05:00
|
|
|
|
|
|
|
Some errors occurred: E0503, E0506, E0510.
|
|
|
|
For more information about an error, try `rustc --explain E0503`.
|