We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
borrowck-assign-to-subfield
1 parent 179c054 commit 65d55afCopy full SHA for 65d55af
src/test/compile-fail/borrowck-assign-to-subfield.rs renamed to src/test/run-pass/borrowck-assign-to-subfield.rs
@@ -8,23 +8,17 @@
8
// option. This file may not be copied, modified, or distributed
9
// except according to those terms.
10
11
-#[feature(managed_boxes)];
12
-
13
fn main() {
14
struct A {
15
a: int,
16
w: B,
17
- x: @B,
18
- z: @mut B
19
}
20
struct B {
21
a: int
22
23
let mut p = A {
24
a: 1,
25
w: B {a: 1},
26
- x: @B {a: 1},
27
- z: @mut B {a: 1}
28
};
29
30
// even though `x` is not declared as a mutable field,
@@ -33,9 +27,4 @@ fn main() {
33
34
// this is true for an interior field too
35
p.w.a = 2;
36
37
- // in these cases we pass through a box, so the mut
38
- // of the box is dominant
39
- p.x.a = 2; //~ ERROR cannot assign to immutable field
40
- p.z.a = 2;
41
0 commit comments