updates to existing ui/borrowck tests.
This commit is contained in:
parent
4229739038
commit
b10beb3233
21 changed files with 137 additions and 142 deletions
|
|
@ -1,9 +1,15 @@
|
|||
error[E0381]: use of possibly uninitialized variable: `x`
|
||||
--> $DIR/assign_mutable_fields.rs:29:10
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `x`
|
||||
--> $DIR/assign_mutable_fields.rs:19:5
|
||||
|
|
||||
LL | drop(x); //~ ERROR
|
||||
| ^ use of possibly uninitialized `x`
|
||||
LL | x.0 = 1;
|
||||
| ^^^^^^^ use of possibly uninitialized `x`
|
||||
|
||||
error: aborting due to previous error
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `x`
|
||||
--> $DIR/assign_mutable_fields.rs:27:5
|
||||
|
|
||||
LL | x.0 = 1;
|
||||
| ^^^^^^^ use of possibly uninitialized `x`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0381`.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0382]: use of moved value: `*x.b`
|
||||
error[E0382]: use of moved value: `x.b`
|
||||
--> $DIR/borrowck-field-sensitivity.rs:18:10
|
||||
|
|
||||
LL | drop(x.b);
|
||||
|
|
@ -6,7 +6,7 @@ LL | drop(x.b);
|
|||
LL | drop(*x.b); //~ ERROR use of moved value: `*x.b`
|
||||
| ^^^^ value used here after move
|
||||
|
||||
error[E0382]: use of moved value: `*x.b`
|
||||
error[E0382]: use of moved value: `x.b`
|
||||
--> $DIR/borrowck-field-sensitivity.rs:24:10
|
||||
|
|
||||
LL | let y = A { a: 3, .. x };
|
||||
|
|
@ -104,7 +104,25 @@ LL | let _z = A { a: 4, .. x }; //~ ERROR use of moved value: `x.b`
|
|||
|
|
||||
= note: move occurs because `x.b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait
|
||||
|
||||
error: aborting due to 11 previous errors
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-field-sensitivity.rs:91:5
|
||||
|
|
||||
LL | x.a = 1;
|
||||
| ^^^^^^^ use of possibly uninitialized `x`
|
||||
|
||||
Some errors occurred: E0382, E0499, E0505.
|
||||
For more information about an error, try `rustc --explain E0382`.
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-field-sensitivity.rs:97:5
|
||||
|
|
||||
LL | x.a = 1;
|
||||
| ^^^^^^^ use of possibly uninitialized `x`
|
||||
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-field-sensitivity.rs:104:5
|
||||
|
|
||||
LL | x.b = box 1;
|
||||
| ^^^ use of possibly uninitialized `x`
|
||||
|
||||
error: aborting due to 14 previous errors
|
||||
|
||||
Some errors occurred: E0381, E0382, E0499, E0505.
|
||||
For more information about an error, try `rustc --explain E0381`.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0381]: use of possibly uninitialized variable: `origin.y`
|
||||
error[E0381]: use of possibly uninitialized variable: `origin`
|
||||
--> $DIR/borrowck-init-in-fru.rs:22:5
|
||||
|
|
||||
LL | origin = point {x: 10,.. origin};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0381]: use of possibly uninitialized variable: `origin.y`
|
||||
error[E0381]: use of possibly uninitialized variable: `origin`
|
||||
--> $DIR/borrowck-init-in-fru.rs:22:5
|
||||
|
|
||||
LL | origin = point {x: 10,.. origin};
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
error[E0381]: use of possibly uninitialized variable: `a.x`
|
||||
error[E0381]: use of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-field-access.rs:34:13
|
||||
|
|
||||
LL | let _ = a.x + 1; //[ast]~ ERROR use of possibly uninitialized variable: `a.x`
|
||||
| ^^^ use of possibly uninitialized `a.x`
|
||||
|
||||
error[E0382]: use of moved value: `line1.origin.x`
|
||||
error[E0382]: use of moved value: `line1.origin`
|
||||
--> $DIR/borrowck-uninit-field-access.rs:39:13
|
||||
|
|
||||
LL | let _moved = line1.origin;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
error[E0381]: use of possibly uninitialized variable: `a.x`
|
||||
error[E0381]: use of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-field-access.rs:34:13
|
||||
|
|
||||
LL | let _ = a.x + 1; //[ast]~ ERROR use of possibly uninitialized variable: `a.x`
|
||||
| ^^^ use of possibly uninitialized `a.x`
|
||||
|
||||
error[E0382]: use of moved value: `line1.origin.x`
|
||||
error[E0382]: use of moved value: `line1.origin`
|
||||
--> $DIR/borrowck-uninit-field-access.rs:39:13
|
||||
|
|
||||
LL | let _moved = line1.origin;
|
||||
|
|
|
|||
|
|
@ -1,33 +1,45 @@
|
|||
error[E0381]: borrow of possibly uninitialized variable: `**x`
|
||||
error[E0381]: borrow of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:21:14
|
||||
|
|
||||
LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381]
|
||||
| ^^^^ use of possibly uninitialized `**x`
|
||||
|
||||
error[E0381]: borrow of possibly uninitialized variable: `**x`
|
||||
error[E0381]: borrow of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:25:14
|
||||
|
|
||||
LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381]
|
||||
| ^^^^ use of possibly uninitialized `**x`
|
||||
|
||||
error[E0381]: borrow of possibly uninitialized variable: `**x`
|
||||
error[E0381]: borrow of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:29:14
|
||||
|
|
||||
LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381]
|
||||
| ^^^^ use of possibly uninitialized `**x`
|
||||
|
||||
error[E0381]: borrow of possibly uninitialized variable: `a.y`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:46:14
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:34:5
|
||||
|
|
||||
LL | let _b = &a.y; //[ast]~ ERROR use of possibly uninitialized variable: `a.y` [E0381]
|
||||
| ^^^^ use of possibly uninitialized `a.y`
|
||||
LL | a.x = 0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
| ^^^^^^^ use of possibly uninitialized `a`
|
||||
|
||||
error[E0381]: borrow of possibly uninitialized variable: `**a.y`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:51:14
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:39:5
|
||||
|
|
||||
LL | let _b = &**a.y; //[ast]~ ERROR use of possibly uninitialized variable: `**a.y` [E0381]
|
||||
| ^^^^^^ use of possibly uninitialized `**a.y`
|
||||
LL | a.x = &&0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
| ^^^^^^^^^ use of possibly uninitialized `a`
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:45:5
|
||||
|
|
||||
LL | a.x = 0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
| ^^^^^^^ use of possibly uninitialized `a`
|
||||
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:50:5
|
||||
|
|
||||
LL | a.x = &&0; //[mir]~ assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
| ^^^^^^^^^ use of possibly uninitialized `a`
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0381`.
|
||||
|
|
|
|||
|
|
@ -1,33 +1,45 @@
|
|||
error[E0381]: borrow of possibly uninitialized variable: `**x`
|
||||
error[E0381]: borrow of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:21:14
|
||||
|
|
||||
LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381]
|
||||
| ^^^^ use of possibly uninitialized `**x`
|
||||
|
||||
error[E0381]: borrow of possibly uninitialized variable: `**x`
|
||||
error[E0381]: borrow of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:25:14
|
||||
|
|
||||
LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381]
|
||||
| ^^^^ use of possibly uninitialized `**x`
|
||||
|
||||
error[E0381]: borrow of possibly uninitialized variable: `**x`
|
||||
error[E0381]: borrow of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:29:14
|
||||
|
|
||||
LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381]
|
||||
| ^^^^ use of possibly uninitialized `**x`
|
||||
|
||||
error[E0381]: borrow of possibly uninitialized variable: `a.y`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:46:14
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:34:5
|
||||
|
|
||||
LL | let _b = &a.y; //[ast]~ ERROR use of possibly uninitialized variable: `a.y` [E0381]
|
||||
| ^^^^ use of possibly uninitialized `a.y`
|
||||
LL | a.x = 0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
| ^^^^^^^ use of possibly uninitialized `a`
|
||||
|
||||
error[E0381]: borrow of possibly uninitialized variable: `**a.y`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:51:14
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:39:5
|
||||
|
|
||||
LL | let _b = &**a.y; //[ast]~ ERROR use of possibly uninitialized variable: `**a.y` [E0381]
|
||||
| ^^^^^^ use of possibly uninitialized `**a.y`
|
||||
LL | a.x = &&0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
| ^^^^^^^^^ use of possibly uninitialized `a`
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:45:5
|
||||
|
|
||||
LL | a.x = 0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
| ^^^^^^^ use of possibly uninitialized `a`
|
||||
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `a`
|
||||
--> $DIR/borrowck-uninit-ref-chain.rs:50:5
|
||||
|
|
||||
LL | a.x = &&0; //[mir]~ assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
| ^^^^^^^^^ use of possibly uninitialized `a`
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0381`.
|
||||
|
|
|
|||
|
|
@ -31,23 +31,23 @@ fn main() {
|
|||
|
||||
|
||||
let mut a: S<i32, i32>;
|
||||
a.x = 0;
|
||||
a.x = 0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
let _b = &a.x; //[ast]~ ERROR use of possibly uninitialized variable: `a.x` [E0381]
|
||||
// (deliberately *not* an error under MIR-borrowck)
|
||||
|
||||
|
||||
let mut a: S<&&i32, &&i32>;
|
||||
a.x = &&0;
|
||||
a.x = &&0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
let _b = &**a.x; //[ast]~ ERROR use of possibly uninitialized variable: `**a.x` [E0381]
|
||||
// (deliberately *not* an error under MIR-borrowck)
|
||||
|
||||
|
||||
|
||||
let mut a: S<i32, i32>;
|
||||
a.x = 0;
|
||||
a.x = 0; //[mir]~ ERROR assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
let _b = &a.y; //[ast]~ ERROR use of possibly uninitialized variable: `a.y` [E0381]
|
||||
//[mir]~^ ERROR [E0381]
|
||||
|
||||
|
||||
let mut a: S<&&i32, &&i32>;
|
||||
a.x = &&0;
|
||||
a.x = &&0; //[mir]~ assign to part of possibly uninitialized variable: `a` [E0381]
|
||||
let _b = &**a.y; //[ast]~ ERROR use of possibly uninitialized variable: `**a.y` [E0381]
|
||||
//[mir]~^ ERROR [E0381]
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0382]: use of moved value: `u.a`
|
||||
error[E0382]: use of moved value: `u`
|
||||
--> $DIR/borrowck-union-move-assign.rs:27:21
|
||||
|
|
||||
LL | let a = u.a;
|
||||
|
|
@ -8,7 +8,7 @@ LL | let a = u.a; //~ ERROR use of moved value: `u.a`
|
|||
|
|
||||
= note: move occurs because `u` has type `U`, which does not implement the `Copy` trait
|
||||
|
||||
error[E0382]: use of moved value: `u.a`
|
||||
error[E0382]: use of moved value: `u`
|
||||
--> $DIR/borrowck-union-move-assign.rs:33:21
|
||||
|
|
||||
LL | let a = u.a;
|
||||
|
|
@ -19,7 +19,7 @@ LL | let a = u.a; // OK
|
|||
|
|
||||
= note: move occurs because `u` has type `U`, which does not implement the `Copy` trait
|
||||
|
||||
error[E0382]: use of moved value: `u.a`
|
||||
error[E0382]: use of moved value: `u`
|
||||
--> $DIR/borrowck-union-move-assign.rs:39:21
|
||||
|
|
||||
LL | let a = u.a;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0382]: use of moved value: `u.n1`
|
||||
error[E0382]: use of moved value: `u`
|
||||
--> $DIR/borrowck-union-move.rs:36:21
|
||||
|
|
||||
LL | let a = u.n1;
|
||||
|
|
@ -18,7 +18,7 @@ LL | let a = u; //~ ERROR use of partially moved value: `u`
|
|||
|
|
||||
= note: move occurs because `u` has type `Unn`, which does not implement the `Copy` trait
|
||||
|
||||
error[E0382]: use of moved value: `u.n2`
|
||||
error[E0382]: use of moved value: `u`
|
||||
--> $DIR/borrowck-union-move.rs:46:21
|
||||
|
|
||||
LL | let a = u.n1;
|
||||
|
|
@ -28,7 +28,7 @@ LL | let a = u.n2; //~ ERROR use of moved value: `u.n2`
|
|||
|
|
||||
= note: move occurs because `u` has type `Unn`, which does not implement the `Copy` trait
|
||||
|
||||
error[E0382]: use of moved value: `u.n`
|
||||
error[E0382]: use of moved value: `u`
|
||||
--> $DIR/borrowck-union-move.rs:73:21
|
||||
|
|
||||
LL | let a = u.n;
|
||||
|
|
@ -38,7 +38,7 @@ LL | let a = u.n; //~ ERROR use of moved value: `u.n`
|
|||
|
|
||||
= note: move occurs because `u` has type `Ucn`, which does not implement the `Copy` trait
|
||||
|
||||
error[E0382]: use of moved value: `u.c`
|
||||
error[E0382]: use of moved value: `u`
|
||||
--> $DIR/borrowck-union-move.rs:78:21
|
||||
|
|
||||
LL | let a = u.n;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,15 @@
|
|||
error[E0381]: use of possibly uninitialized variable: `u.a`
|
||||
--> $DIR/borrowck-union-uninitialized.rs:26:18
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `s`
|
||||
--> $DIR/borrowck-union-uninitialized.rs:23:9
|
||||
|
|
||||
LL | let ua = u.a; //~ ERROR use of possibly uninitialized variable: `u.a`
|
||||
| ^^^ use of possibly uninitialized `u.a`
|
||||
LL | s.a = 0;
|
||||
| ^^^^^^^ use of possibly uninitialized `s`
|
||||
|
||||
error: aborting due to previous error
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `u`
|
||||
--> $DIR/borrowck-union-uninitialized.rs:24:9
|
||||
|
|
||||
LL | u.a = 0;
|
||||
| ^^^^^^^ use of possibly uninitialized `u`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0381`.
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
error[E0381]: use of possibly uninitialized variable: `*w`
|
||||
error[E0381]: use of possibly uninitialized variable: `w`
|
||||
--> $DIR/borrowck-use-in-index-lvalue.rs:16:5
|
||||
|
|
||||
LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381]
|
||||
| ^^^^ use of possibly uninitialized `*w`
|
||||
|
||||
error[E0381]: use of possibly uninitialized variable: `*w`
|
||||
error[E0381]: use of possibly uninitialized variable: `w`
|
||||
--> $DIR/borrowck-use-in-index-lvalue.rs:20:5
|
||||
|
|
||||
LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381]
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
error[E0381]: use of possibly uninitialized variable: `*w`
|
||||
error[E0381]: use of possibly uninitialized variable: `w`
|
||||
--> $DIR/borrowck-use-in-index-lvalue.rs:16:5
|
||||
|
|
||||
LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381]
|
||||
| ^^^^ use of possibly uninitialized `*w`
|
||||
|
||||
error[E0381]: use of possibly uninitialized variable: `*w`
|
||||
error[E0381]: use of possibly uninitialized variable: `w`
|
||||
--> $DIR/borrowck-use-in-index-lvalue.rs:20:5
|
||||
|
|
||||
LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0381]: borrow of possibly uninitialized variable: `*x`
|
||||
error[E0381]: borrow of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-use-uninitialized-in-cast-trait.rs:22:13
|
||||
|
|
||||
LL | let y = x as *const Foo; //[ast]~ ERROR use of possibly uninitialized variable: `*x`
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0381]: borrow of possibly uninitialized variable: `*x`
|
||||
error[E0381]: borrow of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-use-uninitialized-in-cast-trait.rs:22:13
|
||||
|
|
||||
LL | let y = x as *const Foo; //[ast]~ ERROR use of possibly uninitialized variable: `*x`
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0381]: borrow of possibly uninitialized variable: `*x`
|
||||
error[E0381]: borrow of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-use-uninitialized-in-cast.rs:20:13
|
||||
|
|
||||
LL | let y = x as *const i32; //[ast]~ ERROR use of possibly uninitialized variable: `*x` [E0381]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0381]: borrow of possibly uninitialized variable: `*x`
|
||||
error[E0381]: borrow of possibly uninitialized variable: `x`
|
||||
--> $DIR/borrowck-use-uninitialized-in-cast.rs:20:13
|
||||
|
|
||||
LL | let y = x as *const i32; //[ast]~ ERROR use of possibly uninitialized variable: `*x` [E0381]
|
||||
|
|
|
|||
|
|
@ -1,44 +1,15 @@
|
|||
error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `x`
|
||||
--> $DIR/reassignment_immutable_fields.rs:17:5
|
||||
|
|
||||
LL | let x: (u32, u32);
|
||||
| - help: consider changing this to be mutable: `mut x`
|
||||
LL | x.0 = 1; //~ ERROR
|
||||
| ^^^^^^^ cannot assign
|
||||
| ^^^^^^^ use of possibly uninitialized `x`
|
||||
|
||||
error[E0594]: cannot assign to `x.1`, as `x` is not declared as mutable
|
||||
--> $DIR/reassignment_immutable_fields.rs:18:5
|
||||
|
|
||||
LL | let x: (u32, u32);
|
||||
| - help: consider changing this to be mutable: `mut x`
|
||||
LL | x.0 = 1; //~ ERROR
|
||||
LL | x.1 = 22; //~ ERROR
|
||||
| ^^^^^^^^ cannot assign
|
||||
|
||||
error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `x`
|
||||
--> $DIR/reassignment_immutable_fields.rs:25:5
|
||||
|
|
||||
LL | let x: (u32, u32);
|
||||
| - help: consider changing this to be mutable: `mut x`
|
||||
LL | x.0 = 1; //~ ERROR
|
||||
| ^^^^^^^ cannot assign
|
||||
| ^^^^^^^ use of possibly uninitialized `x`
|
||||
|
||||
error[E0594]: cannot assign to `x.1`, as `x` is not declared as mutable
|
||||
--> $DIR/reassignment_immutable_fields.rs:26:5
|
||||
|
|
||||
LL | let x: (u32, u32);
|
||||
| - help: consider changing this to be mutable: `mut x`
|
||||
LL | x.0 = 1; //~ ERROR
|
||||
LL | x.1 = 22; //~ ERROR
|
||||
| ^^^^^^^^ cannot assign
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
error[E0381]: use of possibly uninitialized variable: `x`
|
||||
--> $DIR/reassignment_immutable_fields.rs:27:10
|
||||
|
|
||||
LL | drop(x); //~ ERROR
|
||||
| ^ use of possibly uninitialized `x`
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
Some errors occurred: E0381, E0594.
|
||||
For more information about an error, try `rustc --explain E0381`.
|
||||
For more information about this error, try `rustc --explain E0381`.
|
||||
|
|
|
|||
|
|
@ -1,20 +1,9 @@
|
|||
error[E0594]: cannot assign to `x.a`, as `x` is not declared as mutable
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `x`
|
||||
--> $DIR/reassignment_immutable_fields_overlapping.rs:22:5
|
||||
|
|
||||
LL | let x: Foo;
|
||||
| - help: consider changing this to be mutable: `mut x`
|
||||
LL | x.a = 1; //~ ERROR
|
||||
| ^^^^^^^ cannot assign
|
||||
| ^^^^^^^ use of possibly uninitialized `x`
|
||||
|
||||
error[E0594]: cannot assign to `x.b`, as `x` is not declared as mutable
|
||||
--> $DIR/reassignment_immutable_fields_overlapping.rs:23:5
|
||||
|
|
||||
LL | let x: Foo;
|
||||
| - help: consider changing this to be mutable: `mut x`
|
||||
LL | x.a = 1; //~ ERROR
|
||||
LL | x.b = 22; //~ ERROR
|
||||
| ^^^^^^^^ cannot assign
|
||||
error: aborting due to previous error
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
For more information about this error, try `rustc --explain E0381`.
|
||||
|
|
|
|||
|
|
@ -7,32 +7,13 @@ LL | x = (22, 44);
|
|||
LL | x.0 = 1; //~ ERROR
|
||||
| ^^^^^^^ cannot assign
|
||||
|
||||
error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
|
||||
error[E0381]: assign to part of possibly uninitialized variable: `x`
|
||||
--> $DIR/reassignment_immutable_fields_twice.rs:22:5
|
||||
|
|
||||
LL | let x: (u32, u32);
|
||||
| - help: consider changing this to be mutable: `mut x`
|
||||
LL | x.0 = 1; //~ ERROR
|
||||
| ^^^^^^^ cannot assign
|
||||
| ^^^^^^^ use of possibly uninitialized `x`
|
||||
|
||||
error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable
|
||||
--> $DIR/reassignment_immutable_fields_twice.rs:23:5
|
||||
|
|
||||
LL | let x: (u32, u32);
|
||||
| - help: consider changing this to be mutable: `mut x`
|
||||
LL | x.0 = 1; //~ ERROR
|
||||
LL | x.0 = 22; //~ ERROR
|
||||
| ^^^^^^^^ cannot assign
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
error[E0594]: cannot assign to `x.1`, as `x` is not declared as mutable
|
||||
--> $DIR/reassignment_immutable_fields_twice.rs:24:5
|
||||
|
|
||||
LL | let x: (u32, u32);
|
||||
| - help: consider changing this to be mutable: `mut x`
|
||||
...
|
||||
LL | x.1 = 44; //~ ERROR
|
||||
| ^^^^^^^^ cannot assign
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0594`.
|
||||
Some errors occurred: E0381, E0594.
|
||||
For more information about an error, try `rustc --explain E0381`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue