|
| 1 | +error[E0594]: cannot assign to `x`, as it is not declared as mutable |
| 2 | + --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:21:46 |
| 3 | + | |
| 4 | +LL | pub fn e(x: &'static mut isize) { |
| 5 | + | - help: consider changing this to be mutable: `mut x` |
| 6 | +LL | static mut Y: isize = 3; |
| 7 | +LL | let mut c1 = |y: &'static mut isize| x = y; |
| 8 | + | ^^^^^ cannot assign |
| 9 | + |
| 10 | +error[E0594]: cannot assign to `x`, as it is not declared as mutable |
| 11 | + --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:30:50 |
| 12 | + | |
| 13 | +LL | pub fn ee(x: &'static mut isize) { |
| 14 | + | - help: consider changing this to be mutable: `mut x` |
| 15 | +... |
| 16 | +LL | let mut c2 = |y: &'static mut isize| x = y; |
| 17 | + | ^^^^^ cannot assign |
| 18 | + |
| 19 | +error[E0594]: cannot assign to `x`, as it is not declared as mutable |
| 20 | + --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:40:14 |
| 21 | + | |
| 22 | +LL | pub fn capture_assign_whole(x: (i32,)) { |
| 23 | + | - help: consider changing this to be mutable: `mut x` |
| 24 | +LL | || { x = (1,); }; |
| 25 | + | ^^^^^^^^ cannot assign |
| 26 | + |
| 27 | +error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable |
| 28 | + --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:43:14 |
| 29 | + | |
| 30 | +LL | pub fn capture_assign_part(x: (i32,)) { |
| 31 | + | - help: consider changing this to be mutable: `mut x` |
| 32 | +LL | || { x.0 = 1; }; |
| 33 | + | ^^^^^^^ cannot assign |
| 34 | + |
| 35 | +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable |
| 36 | + --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:46:14 |
| 37 | + | |
| 38 | +LL | pub fn capture_reborrow_whole(x: (i32,)) { |
| 39 | + | - help: consider changing this to be mutable: `mut x` |
| 40 | +LL | || { &mut x; }; |
| 41 | + | ^^^^^^ cannot borrow as mutable |
| 42 | + |
| 43 | +error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable |
| 44 | + --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:49:14 |
| 45 | + | |
| 46 | +LL | pub fn capture_reborrow_part(x: (i32,)) { |
| 47 | + | - help: consider changing this to be mutable: `mut x` |
| 48 | +LL | || { &mut x.0; }; |
| 49 | + | ^^^^^^^^ cannot borrow as mutable |
| 50 | + |
| 51 | +error: aborting due to 6 previous errors |
| 52 | + |
| 53 | +Some errors occurred: E0594, E0596. |
| 54 | +For more information about an error, try `rustc --explain E0594`. |
0 commit comments