rust/tests/ui/pattern/mut-ref-mut-2021.stderr
Jules Bertholet 528d45af18
Feature gate
2024-03-27 11:20:28 -04:00

71 lines
2.3 KiB
Plaintext

error[E0384]: cannot assign twice to immutable variable `a`
--> $DIR/mut-ref-mut-2021.rs:9:5
|
LL | let Foo(a) = Foo(0);
| -
| |
| first assignment to `a`
| help: consider making this binding mutable: `mut a`
LL | a = 42;
| ^^^^^^ cannot assign twice to immutable variable
error[E0384]: cannot assign twice to immutable variable `a`
--> $DIR/mut-ref-mut-2021.rs:15:5
|
LL | let Foo(ref a) = Foo(0);
| ----- first assignment to `a`
LL | a = &42;
| ^^^^^^^ cannot assign twice to immutable variable
error[E0384]: cannot assign twice to immutable variable `a`
--> $DIR/mut-ref-mut-2021.rs:21:5
|
LL | let Foo(ref mut a) = Foo(0);
| --------- first assignment to `a`
LL | a = &mut 42;
| ^^^^^^^^^^^ cannot assign twice to immutable variable
error[E0384]: cannot assign twice to immutable variable `a`
--> $DIR/mut-ref-mut-2021.rs:27:5
|
LL | let Foo(a) = &Foo(0);
| - first assignment to `a`
LL | a = &42;
| ^^^^^^^ cannot assign twice to immutable variable
error[E0384]: cannot assign twice to immutable variable `a`
--> $DIR/mut-ref-mut-2021.rs:33:5
|
LL | let Foo(ref a) = &Foo(0);
| ----- first assignment to `a`
LL | a = &42;
| ^^^^^^^ cannot assign twice to immutable variable
error[E0384]: cannot assign twice to immutable variable `a`
--> $DIR/mut-ref-mut-2021.rs:39:5
|
LL | let Foo(a) = &mut Foo(0);
| - first assignment to `a`
LL | a = &mut 42;
| ^^^^^^^^^^^ cannot assign twice to immutable variable
error[E0384]: cannot assign twice to immutable variable `a`
--> $DIR/mut-ref-mut-2021.rs:45:5
|
LL | let Foo(ref a) = &mut Foo(0);
| ----- first assignment to `a`
LL | a = &42;
| ^^^^^^^ cannot assign twice to immutable variable
error[E0384]: cannot assign twice to immutable variable `a`
--> $DIR/mut-ref-mut-2021.rs:51:5
|
LL | let Foo(ref mut a) = &mut Foo(0);
| --------- first assignment to `a`
LL | a = &mut 42;
| ^^^^^^^^^^^ cannot assign twice to immutable variable
error: aborting due to 8 previous errors
For more information about this error, try `rustc --explain E0384`.