2018-08-08 12:28:26 +00:00
|
|
|
error[E0384]: cannot assign twice to immutable variable `x`
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-match-binding-is-assignment.rs:14:13
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | x => {
|
2024-01-06 05:13:18 +00:00
|
|
|
| - first assignment to `x`
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | x += 1;
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^^^^ cannot assign twice to immutable variable
|
2024-01-06 05:13:18 +00:00
|
|
|
|
|
|
|
|
help: consider making this binding mutable
|
|
|
|
|
|
|
|
|
LL | mut x => {
|
2024-07-03 21:01:29 +00:00
|
|
|
| +++
|
2024-01-06 05:13:18 +00:00
|
|
|
help: to modify the original value, take a borrow instead
|
|
|
|
|
|
|
|
|
LL | ref mut x => {
|
2024-07-03 21:01:29 +00:00
|
|
|
| +++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0384]: cannot assign twice to immutable variable `x`
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-match-binding-is-assignment.rs:20:13
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | E::Foo(x) => {
|
2024-01-06 05:13:18 +00:00
|
|
|
| - first assignment to `x`
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | x += 1;
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^^^^ cannot assign twice to immutable variable
|
2024-01-06 05:13:18 +00:00
|
|
|
|
|
|
|
|
help: consider making this binding mutable
|
|
|
|
|
|
|
|
|
LL | E::Foo(mut x) => {
|
2024-07-03 21:01:29 +00:00
|
|
|
| +++
|
2024-01-06 05:13:18 +00:00
|
|
|
help: to modify the original value, take a borrow instead
|
|
|
|
|
|
|
|
|
LL | E::Foo(ref mut x) => {
|
2024-07-03 21:01:29 +00:00
|
|
|
| +++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0384]: cannot assign twice to immutable variable `x`
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-match-binding-is-assignment.rs:26:13
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | S { bar: x } => {
|
2024-01-06 05:13:18 +00:00
|
|
|
| - first assignment to `x`
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | x += 1;
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^^^^ cannot assign twice to immutable variable
|
2024-01-06 05:13:18 +00:00
|
|
|
|
|
|
|
|
help: consider making this binding mutable
|
|
|
|
|
|
|
|
|
LL | S { bar: mut x } => {
|
2024-07-03 21:01:29 +00:00
|
|
|
| +++
|
2024-01-06 05:13:18 +00:00
|
|
|
help: to modify the original value, take a borrow instead
|
|
|
|
|
|
|
|
|
LL | S { bar: ref mut x } => {
|
2024-07-03 21:01:29 +00:00
|
|
|
| +++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0384]: cannot assign twice to immutable variable `x`
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-match-binding-is-assignment.rs:32:13
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | (x,) => {
|
2024-01-06 05:13:18 +00:00
|
|
|
| - first assignment to `x`
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | x += 1;
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^^^^ cannot assign twice to immutable variable
|
2024-01-06 05:13:18 +00:00
|
|
|
|
|
|
|
|
help: consider making this binding mutable
|
|
|
|
|
|
|
|
|
LL | (mut x,) => {
|
2024-07-03 21:01:29 +00:00
|
|
|
| +++
|
2024-01-06 05:13:18 +00:00
|
|
|
help: to modify the original value, take a borrow instead
|
|
|
|
|
|
|
|
|
LL | (ref mut x,) => {
|
2024-07-03 21:01:29 +00:00
|
|
|
| +++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0384]: cannot assign twice to immutable variable `x`
|
2019-04-22 07:40:08 +00:00
|
|
|
--> $DIR/borrowck-match-binding-is-assignment.rs:38:13
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | [x,_,_] => {
|
2024-01-06 05:13:18 +00:00
|
|
|
| - first assignment to `x`
|
2019-03-17 09:52:07 +00:00
|
|
|
LL | x += 1;
|
2018-08-08 12:28:26 +00:00
|
|
|
| ^^^^^^ cannot assign twice to immutable variable
|
2024-01-06 05:13:18 +00:00
|
|
|
|
|
|
|
|
help: consider making this binding mutable
|
|
|
|
|
|
|
|
|
LL | [mut x,_,_] => {
|
2024-07-03 21:01:29 +00:00
|
|
|
| +++
|
2024-01-06 05:13:18 +00:00
|
|
|
help: to modify the original value, take a borrow instead
|
|
|
|
|
|
|
|
|
LL | [ref mut x,_,_] => {
|
2024-07-03 21:01:29 +00:00
|
|
|
| +++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error: aborting due to 5 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0384`.
|