]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mut/mut-pattern-internal-mutability.mir.stderr
Rollup merge of #54257 - alexcrichton:wasm-math-symbols, r=TimNN
[rust.git] / src / test / ui / mut / mut-pattern-internal-mutability.mir.stderr
1 error[E0384]: cannot assign twice to immutable variable `x`
2   --> $DIR/mut-pattern-internal-mutability.rs:18:5
3    |
4 LL |     let &mut x = foo;
5    |              -
6    |              |
7    |              first assignment to `x`
8    |              help: make this binding mutable: `mut x`
9 LL |     x += 1; //[ast]~ ERROR cannot assign twice to immutable variable
10    |     ^^^^^^ cannot assign twice to immutable variable
11
12 error[E0506]: cannot assign to `*foo` because it is borrowed
13   --> $DIR/mut-pattern-internal-mutability.rs:27:5
14    |
15 LL |     let &mut ref x = foo;
16    |              ----- borrow of `*foo` occurs here
17 LL |     *foo += 1; //[ast]~ ERROR cannot assign to `*foo` because it is borrowed
18    |     ^^^^^^^^^ assignment to borrowed `*foo` occurs here
19 LL |     //[mir]~^ ERROR cannot assign to `*foo` because it is borrowed
20 LL |     drop(x);
21    |          - borrow later used here
22
23 error: aborting due to 2 previous errors
24
25 Some errors occurred: E0384, E0506.
26 For more information about an error, try `rustc --explain E0384`.