|
| 1 | +error[E0594]: cannot assign to field `t.0` of immutable binding |
| 2 | + --> $DIR/issue-54499-field-mutation-of-moved-out.rs:23:9 |
| 3 | + | |
| 4 | +LL | let t: Tuple = (S(0), 0); |
| 5 | + | - help: make this binding mutable: `mut t` |
| 6 | +LL | drop(t); |
| 7 | +LL | t.0 = S(1); |
| 8 | + | ^^^^^^^^^^ cannot mutably borrow field of immutable binding |
| 9 | + |
| 10 | +error[E0594]: cannot assign to field `t.1` of immutable binding |
| 11 | + --> $DIR/issue-54499-field-mutation-of-moved-out.rs:27:9 |
| 12 | + | |
| 13 | +LL | let t: Tuple = (S(0), 0); |
| 14 | + | - help: make this binding mutable: `mut t` |
| 15 | +... |
| 16 | +LL | t.1 = 2; |
| 17 | + | ^^^^^^^ cannot mutably borrow field of immutable binding |
| 18 | + |
| 19 | +error[E0594]: cannot assign to field `u.0` of immutable binding |
| 20 | + --> $DIR/issue-54499-field-mutation-of-moved-out.rs:38:9 |
| 21 | + | |
| 22 | +LL | let u: Tpair = Tpair(S(0), 0); |
| 23 | + | - help: make this binding mutable: `mut u` |
| 24 | +LL | drop(u); |
| 25 | +LL | u.0 = S(1); |
| 26 | + | ^^^^^^^^^^ cannot mutably borrow field of immutable binding |
| 27 | + |
| 28 | +error[E0594]: cannot assign to field `u.1` of immutable binding |
| 29 | + --> $DIR/issue-54499-field-mutation-of-moved-out.rs:42:9 |
| 30 | + | |
| 31 | +LL | let u: Tpair = Tpair(S(0), 0); |
| 32 | + | - help: make this binding mutable: `mut u` |
| 33 | +... |
| 34 | +LL | u.1 = 2; |
| 35 | + | ^^^^^^^ cannot mutably borrow field of immutable binding |
| 36 | + |
| 37 | +error[E0594]: cannot assign to field `v.x` of immutable binding |
| 38 | + --> $DIR/issue-54499-field-mutation-of-moved-out.rs:53:9 |
| 39 | + | |
| 40 | +LL | let v: Spair = Spair { x: S(0), y: 0 }; |
| 41 | + | - help: make this binding mutable: `mut v` |
| 42 | +LL | drop(v); |
| 43 | +LL | v.x = S(1); |
| 44 | + | ^^^^^^^^^^ cannot mutably borrow field of immutable binding |
| 45 | + |
| 46 | +error[E0594]: cannot assign to field `v.y` of immutable binding |
| 47 | + --> $DIR/issue-54499-field-mutation-of-moved-out.rs:57:9 |
| 48 | + | |
| 49 | +LL | let v: Spair = Spair { x: S(0), y: 0 }; |
| 50 | + | - help: make this binding mutable: `mut v` |
| 51 | +... |
| 52 | +LL | v.y = 2; |
| 53 | + | ^^^^^^^ cannot mutably borrow field of immutable binding |
| 54 | + |
| 55 | +error[E0382]: use of moved value: `t.0` |
| 56 | + --> $DIR/issue-54499-field-mutation-of-moved-out.rs:30:31 |
| 57 | + | |
| 58 | +LL | drop(t); |
| 59 | + | - value moved here |
| 60 | +... |
| 61 | +LL | println!("{:?} {:?}", t.0, t.1); |
| 62 | + | ^^^ value used here after move |
| 63 | + | |
| 64 | + = note: move occurs because `t` has type `(S, i32)`, which does not implement the `Copy` trait |
| 65 | + |
| 66 | +error[E0382]: use of moved value: `t.1` |
| 67 | + --> $DIR/issue-54499-field-mutation-of-moved-out.rs:30:36 |
| 68 | + | |
| 69 | +LL | drop(t); |
| 70 | + | - value moved here |
| 71 | +... |
| 72 | +LL | println!("{:?} {:?}", t.0, t.1); |
| 73 | + | ^^^ value used here after move |
| 74 | + | |
| 75 | + = note: move occurs because `t` has type `(S, i32)`, which does not implement the `Copy` trait |
| 76 | + |
| 77 | +error[E0382]: use of moved value: `u.0` |
| 78 | + --> $DIR/issue-54499-field-mutation-of-moved-out.rs:45:31 |
| 79 | + | |
| 80 | +LL | drop(u); |
| 81 | + | - value moved here |
| 82 | +... |
| 83 | +LL | println!("{:?} {:?}", u.0, u.1); |
| 84 | + | ^^^ value used here after move |
| 85 | + | |
| 86 | + = note: move occurs because `u` has type `Tpair`, which does not implement the `Copy` trait |
| 87 | + |
| 88 | +error[E0382]: use of moved value: `u.1` |
| 89 | + --> $DIR/issue-54499-field-mutation-of-moved-out.rs:45:36 |
| 90 | + | |
| 91 | +LL | drop(u); |
| 92 | + | - value moved here |
| 93 | +... |
| 94 | +LL | println!("{:?} {:?}", u.0, u.1); |
| 95 | + | ^^^ value used here after move |
| 96 | + | |
| 97 | + = note: move occurs because `u` has type `Tpair`, which does not implement the `Copy` trait |
| 98 | + |
| 99 | +error[E0382]: use of moved value: `v.x` |
| 100 | + --> $DIR/issue-54499-field-mutation-of-moved-out.rs:60:31 |
| 101 | + | |
| 102 | +LL | drop(v); |
| 103 | + | - value moved here |
| 104 | +... |
| 105 | +LL | println!("{:?} {:?}", v.x, v.y); |
| 106 | + | ^^^ value used here after move |
| 107 | + | |
| 108 | + = note: move occurs because `v` has type `Spair`, which does not implement the `Copy` trait |
| 109 | + |
| 110 | +error[E0382]: use of moved value: `v.y` |
| 111 | + --> $DIR/issue-54499-field-mutation-of-moved-out.rs:60:36 |
| 112 | + | |
| 113 | +LL | drop(v); |
| 114 | + | - value moved here |
| 115 | +... |
| 116 | +LL | println!("{:?} {:?}", v.x, v.y); |
| 117 | + | ^^^ value used here after move |
| 118 | + | |
| 119 | + = note: move occurs because `v` has type `Spair`, which does not implement the `Copy` trait |
| 120 | + |
| 121 | +error: aborting due to 12 previous errors |
| 122 | + |
| 123 | +Some errors occurred: E0382, E0594. |
| 124 | +For more information about an error, try `rustc --explain E0382`. |
0 commit comments