]> git.lizzy.rs Git - rust.git/commitdiff
updates to existing ui/borrowck tests.
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Tue, 16 Oct 2018 15:08:59 +0000 (17:08 +0200)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Tue, 16 Oct 2018 15:11:33 +0000 (17:11 +0200)
21 files changed:
src/test/ui/borrowck/assign_mutable_fields.nll.stderr
src/test/ui/borrowck/borrowck-field-sensitivity.nll.stderr
src/test/ui/borrowck/borrowck-init-in-fru.ast.nll.stderr
src/test/ui/borrowck/borrowck-init-in-fru.mir.stderr
src/test/ui/borrowck/borrowck-uninit-field-access.ast.nll.stderr
src/test/ui/borrowck/borrowck-uninit-field-access.mir.stderr
src/test/ui/borrowck/borrowck-uninit-ref-chain.ast.nll.stderr
src/test/ui/borrowck/borrowck-uninit-ref-chain.mir.stderr
src/test/ui/borrowck/borrowck-uninit-ref-chain.rs
src/test/ui/borrowck/borrowck-union-move-assign.nll.stderr
src/test/ui/borrowck/borrowck-union-move.nll.stderr
src/test/ui/borrowck/borrowck-union-uninitialized.nll.stderr
src/test/ui/borrowck/borrowck-use-in-index-lvalue.ast.nll.stderr
src/test/ui/borrowck/borrowck-use-in-index-lvalue.mir.stderr
src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.nll.stderr
src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.mir.stderr
src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.ast.nll.stderr
src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.mir.stderr
src/test/ui/borrowck/reassignment_immutable_fields.nll.stderr
src/test/ui/borrowck/reassignment_immutable_fields_overlapping.nll.stderr
src/test/ui/borrowck/reassignment_immutable_fields_twice.nll.stderr

index 5147075347283faa1b415158e0622cc2fc24b792..59af97d9f13db6101307ab788f5a59ffd574b780 100644 (file)
@@ -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`.
index 6ac5fef1416afd277ba6fa8d036fd4e2907ce6a3..81d9e958e28e20710504f549718853ee920515dd 100644 (file)
@@ -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`
+
+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: E0382, E0499, E0505.
-For more information about an error, try `rustc --explain E0382`.
+Some errors occurred: E0381, E0382, E0499, E0505.
+For more information about an error, try `rustc --explain E0381`.
index cac9d890dae0f6b8aab8e8282d794ade449bc302..e602597844457ccd1c8a199e6f2e168441a77cf3 100644 (file)
@@ -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};
index cac9d890dae0f6b8aab8e8282d794ade449bc302..e602597844457ccd1c8a199e6f2e168441a77cf3 100644 (file)
@@ -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};
index 9c7dbd7e77884da66beaa834b51c78a86f54eb15..97eb83d0f14efedb1c37a26edfa8a6f608ab338a 100644 (file)
@@ -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;
index 9c7dbd7e77884da66beaa834b51c78a86f54eb15..97eb83d0f14efedb1c37a26edfa8a6f608ab338a 100644 (file)
@@ -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;
index bd9836e3174fba1cb22d27d2b67841d4736a0b45..e9caf7d9e1e7e5f5c3203182215eb00df3619ffc 100644 (file)
@@ -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`.
index bd9836e3174fba1cb22d27d2b67841d4736a0b45..e9caf7d9e1e7e5f5c3203182215eb00df3619ffc 100644 (file)
@@ -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`.
index c52b1f0bf64c00e9be15bad37ec5a40c558a6a39..dc9d8405102eea4fba7cdff22b460d301381917d 100644 (file)
@@ -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]
+
 }
index 2a877050e4c873009465e40c2aba26aee61ee641..423a44514db81525a229aac04a32ca4f7e08bf8d 100644 (file)
@@ -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;
index 6fd6a1c82a1a0e82e88567420366f93873bb1f77..8597117dbcc8a0099d72a9268ec49b5599d375a3 100644 (file)
@@ -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;
index 49bc6d3263660e562c52b0db904d20c4ff9c0e77..94a7a4866e6b90f3aa304e1c6130266939a3a1e0 100644 (file)
@@ -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`.
index d69693eb035320206604ee9ae86732ff31d4e179..502978f25be9435643614686eb486524055a9736 100644 (file)
@@ -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]
index d69693eb035320206604ee9ae86732ff31d4e179..502978f25be9435643614686eb486524055a9736 100644 (file)
@@ -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]
index b96379db650bb9421fec0c95259383052faf59b7..22e95ca3ad0e2ee922383395c2fa6b058361126f 100644 (file)
@@ -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`
index b96379db650bb9421fec0c95259383052faf59b7..22e95ca3ad0e2ee922383395c2fa6b058361126f 100644 (file)
@@ -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`
index 6eddbd934d54ebce9688f2649cf1b369656be801..11897f50910e17df1c4d6965aa57dca33c1b8519 100644 (file)
@@ -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]
index 6eddbd934d54ebce9688f2649cf1b369656be801..11897f50910e17df1c4d6965aa57dca33c1b8519 100644 (file)
@@ -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]
index 97f3bf5b81f66d79dc5b76e01bd4124e9ba5839b..1f0938dd3d27ba168b1fb2421aa0fcd8fe965c22 100644 (file)
@@ -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
-
-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[E0381]: use of possibly uninitialized variable: `x`
-  --> $DIR/reassignment_immutable_fields.rs:27:10
-   |
-LL |     drop(x); //~ ERROR
-   |          ^ use of possibly uninitialized `x`
+   |     ^^^^^^^ use of possibly uninitialized `x`
 
-error: aborting due to 5 previous errors
+error: aborting due to 2 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`.
index c433d6e25c9de134e1919de840ac5f19400dee7f..7da9dbfc088cb5a0f15ef80b27272f918117cc78 100644 (file)
@@ -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 2 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0594`.
+For more information about this error, try `rustc --explain E0381`.
index 2160ae20c425a512e42779043fb21d6c51ee1dba..96677be724131274f26565b030aa8085b25eea1e 100644 (file)
@@ -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
-
-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[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
+   |     ^^^^^^^ use of possibly uninitialized `x`
 
-error: aborting due to 4 previous errors
+error: aborting due to 2 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`.