rust/tests/ui/nll/match-guards-partially-borrow.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

171 lines
4.9 KiB
Plaintext
Raw Normal View History

2018-09-13 21:04:00 +00:00
error[E0510]: cannot assign `q` in match guard
--> $DIR/match-guards-partially-borrow.rs:100:13
2018-09-13 21:04:00 +00:00
|
LL | match q {
| - value is immutable in match guard
...
2019-03-09 12:03:44 +00:00
LL | q = true;
2018-09-13 21:04:00 +00:00
| ^^^^^^^^ cannot assign
error[E0510]: cannot assign `q` in match guard
--> $DIR/match-guards-partially-borrow.rs:111:13
|
LL | match q {
| - value is immutable in match guard
...
LL | q = true;
| ^^^^^^^^ cannot assign
error[E0510]: cannot assign `r` in match guard
--> $DIR/match-guards-partially-borrow.rs:123:13
|
LL | match r {
| - value is immutable in match guard
...
LL | r = true;
| ^^^^^^^^ cannot assign
2018-09-13 21:04:00 +00:00
error[E0510]: cannot assign `r` in match guard
--> $DIR/match-guards-partially-borrow.rs:135:13
2018-09-13 21:04:00 +00:00
|
LL | match r {
| - value is immutable in match guard
...
2019-03-09 12:03:44 +00:00
LL | r = true;
2018-09-13 21:04:00 +00:00
| ^^^^^^^^ cannot assign
error[E0510]: cannot assign `t` in match guard
--> $DIR/match-guards-partially-borrow.rs:172:13
|
LL | match t {
| - value is immutable in match guard
...
LL | t = true;
| ^^^^^^^^ cannot assign
error[E0510]: cannot assign `t` in match guard
--> $DIR/match-guards-partially-borrow.rs:183:13
2018-09-13 21:04:00 +00:00
|
LL | match t {
| - value is immutable in match guard
...
2019-03-09 12:03:44 +00:00
LL | t = true;
2018-09-13 21:04:00 +00:00
| ^^^^^^^^ cannot assign
error[E0510]: cannot mutably borrow `x.0` in match guard
--> $DIR/match-guards-partially-borrow.rs:197:22
|
LL | match x {
| - value is immutable in match guard
...
LL | Some(ref mut r) => *r = None,
| ^^^^^^^^^ cannot mutably borrow
error[E0510]: cannot mutably borrow `x.0` in match guard
--> $DIR/match-guards-partially-borrow.rs:213:22
2018-09-13 21:04:00 +00:00
|
LL | match x {
| - value is immutable in match guard
...
2019-03-09 12:03:44 +00:00
LL | Some(ref mut r) => *r = None,
2018-09-13 21:04:00 +00:00
| ^^^^^^^^^ cannot mutably borrow
error[E0506]: cannot assign to `t` because it is borrowed
--> $DIR/match-guards-partially-borrow.rs:225:13
|
LL | s if {
2023-01-15 03:06:44 +00:00
| - `t` is borrowed here
2019-03-09 12:03:44 +00:00
LL | t = !t;
2023-01-15 03:06:44 +00:00
| ^^^^^^ `t` is assigned to here but it was already borrowed
LL | false
LL | } => (), // What value should `s` have in the arm?
2018-09-13 21:04:00 +00:00
| - borrow later used here
error[E0506]: cannot assign to `t` because it is borrowed
--> $DIR/match-guards-partially-borrow.rs:235:13
|
LL | s if let Some(()) = {
2023-01-15 03:06:44 +00:00
| - `t` is borrowed here
LL | t = !t;
2023-01-15 03:06:44 +00:00
| ^^^^^^ `t` is assigned to here but it was already borrowed
LL | None
LL | } => (), // What value should `s` have in the arm?
| - borrow later used here
error[E0510]: cannot assign `y` in match guard
--> $DIR/match-guards-partially-borrow.rs:246:13
|
LL | match *y {
| -- value is immutable in match guard
...
LL | y = &true;
| ^^^^^^^^^ cannot assign
2018-09-13 21:04:00 +00:00
error[E0510]: cannot assign `y` in match guard
--> $DIR/match-guards-partially-borrow.rs:257:13
2018-09-13 21:04:00 +00:00
|
LL | match *y {
| -- value is immutable in match guard
...
2019-03-09 12:03:44 +00:00
LL | y = &true;
2018-09-13 21:04:00 +00:00
| ^^^^^^^^^ cannot assign
error[E0510]: cannot assign `z` in match guard
--> $DIR/match-guards-partially-borrow.rs:268:13
|
LL | match z {
| - value is immutable in match guard
...
LL | z = &true;
| ^^^^^^^^^ cannot assign
error[E0510]: cannot assign `z` in match guard
--> $DIR/match-guards-partially-borrow.rs:279:13
2018-09-13 21:04:00 +00:00
|
LL | match z {
| - value is immutable in match guard
...
2019-03-09 12:03:44 +00:00
LL | z = &true;
2018-09-13 21:04:00 +00:00
| ^^^^^^^^^ cannot assign
error[E0510]: cannot assign `a` in match guard
--> $DIR/match-guards-partially-borrow.rs:291:13
|
LL | match a {
| - value is immutable in match guard
...
LL | a = &true;
| ^^^^^^^^^ cannot assign
error[E0510]: cannot assign `a` in match guard
--> $DIR/match-guards-partially-borrow.rs:303:13
2018-09-13 21:04:00 +00:00
|
LL | match a {
| - value is immutable in match guard
...
2019-03-09 12:03:44 +00:00
LL | a = &true;
2018-09-13 21:04:00 +00:00
| ^^^^^^^^^ cannot assign
error[E0510]: cannot assign `b` in match guard
--> $DIR/match-guards-partially-borrow.rs:314:13
|
LL | match b {
| - value is immutable in match guard
...
LL | b = &true;
| ^^^^^^^^^ cannot assign
error[E0510]: cannot assign `b` in match guard
--> $DIR/match-guards-partially-borrow.rs:325:13
2018-09-13 21:04:00 +00:00
|
LL | match b {
| - value is immutable in match guard
...
2019-03-09 12:03:44 +00:00
LL | b = &true;
2018-09-13 21:04:00 +00:00
| ^^^^^^^^^ cannot assign
error: aborting due to 18 previous errors
2018-09-13 21:04:00 +00:00
Some errors have detailed explanations: E0506, E0510.
For more information about an error, try `rustc --explain E0506`.