diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2018-10-16 17:08:59 +0200 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2018-10-16 17:11:33 +0200 |
| commit | b10beb3233afcb8622246fd0d5ae4b64e2281f20 (patch) | |
| tree | fab18d868b46a61046a43ed032236f8f57e89865 | |
| parent | 42297390386a9b3f55fec7299b27ee51f41796e3 (diff) | |
| download | rust-b10beb3233afcb8622246fd0d5ae4b64e2281f20.tar.gz rust-b10beb3233afcb8622246fd0d5ae4b64e2281f20.zip | |
updates to existing ui/borrowck tests.
21 files changed, 137 insertions, 142 deletions
diff --git a/src/test/ui/borrowck/assign_mutable_fields.nll.stderr b/src/test/ui/borrowck/assign_mutable_fields.nll.stderr index 51470753472..59af97d9f13 100644 --- a/src/test/ui/borrowck/assign_mutable_fields.nll.stderr +++ b/src/test/ui/borrowck/assign_mutable_fields.nll.stderr @@ -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`. diff --git a/src/test/ui/borrowck/borrowck-field-sensitivity.nll.stderr b/src/test/ui/borrowck/borrowck-field-sensitivity.nll.stderr index 6ac5fef1416..81d9e958e28 100644 --- a/src/test/ui/borrowck/borrowck-field-sensitivity.nll.stderr +++ b/src/test/ui/borrowck/borrowck-field-sensitivity.nll.stderr @@ -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`. diff --git a/src/test/ui/borrowck/borrowck-init-in-fru.ast.nll.stderr b/src/test/ui/borrowck/borrowck-init-in-fru.ast.nll.stderr index cac9d890dae..e6025978444 100644 --- a/src/test/ui/borrowck/borrowck-init-in-fru.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-init-in-fru.ast.nll.stderr @@ -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}; diff --git a/src/test/ui/borrowck/borrowck-init-in-fru.mir.stderr b/src/test/ui/borrowck/borrowck-init-in-fru.mir.stderr index cac9d890dae..e6025978444 100644 --- a/src/test/ui/borrowck/borrowck-init-in-fru.mir.stderr +++ b/src/test/ui/borrowck/borrowck-init-in-fru.mir.stderr @@ -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}; diff --git a/src/test/ui/borrowck/borrowck-uninit-field-access.ast.nll.stderr b/src/test/ui/borrowck/borrowck-uninit-field-access.ast.nll.stderr index 9c7dbd7e778..97eb83d0f14 100644 --- a/src/test/ui/borrowck/borrowck-uninit-field-access.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-uninit-field-access.ast.nll.stderr @@ -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; diff --git a/src/test/ui/borrowck/borrowck-uninit-field-access.mir.stderr b/src/test/ui/borrowck/borrowck-uninit-field-access.mir.stderr index 9c7dbd7e778..97eb83d0f14 100644 --- a/src/test/ui/borrowck/borrowck-uninit-field-access.mir.stderr +++ b/src/test/ui/borrowck/borrowck-uninit-field-access.mir.stderr @@ -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; diff --git a/src/test/ui/borrowck/borrowck-uninit-ref-chain.ast.nll.stderr b/src/test/ui/borrowck/borrowck-uninit-ref-chain.ast.nll.stderr index bd9836e3174..e9caf7d9e1e 100644 --- a/src/test/ui/borrowck/borrowck-uninit-ref-chain.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-uninit-ref-chain.ast.nll.stderr @@ -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`. diff --git a/src/test/ui/borrowck/borrowck-uninit-ref-chain.mir.stderr b/src/test/ui/borrowck/borrowck-uninit-ref-chain.mir.stderr index bd9836e3174..e9caf7d9e1e 100644 --- a/src/test/ui/borrowck/borrowck-uninit-ref-chain.mir.stderr +++ b/src/test/ui/borrowck/borrowck-uninit-ref-chain.mir.stderr @@ -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`. diff --git a/src/test/ui/borrowck/borrowck-uninit-ref-chain.rs b/src/test/ui/borrowck/borrowck-uninit-ref-chain.rs index c52b1f0bf64..dc9d8405102 100644 --- a/src/test/ui/borrowck/borrowck-uninit-ref-chain.rs +++ b/src/test/ui/borrowck/borrowck-uninit-ref-chain.rs @@ -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] + } diff --git a/src/test/ui/borrowck/borrowck-union-move-assign.nll.stderr b/src/test/ui/borrowck/borrowck-union-move-assign.nll.stderr index 2a877050e4c..423a44514db 100644 --- a/src/test/ui/borrowck/borrowck-union-move-assign.nll.stderr +++ b/src/test/ui/borrowck/borrowck-union-move-assign.nll.stderr @@ -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; diff --git a/src/test/ui/borrowck/borrowck-union-move.nll.stderr b/src/test/ui/borrowck/borrowck-union-move.nll.stderr index 6fd6a1c82a1..8597117dbcc 100644 --- a/src/test/ui/borrowck/borrowck-union-move.nll.stderr +++ b/src/test/ui/borrowck/borrowck-union-move.nll.stderr @@ -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; diff --git a/src/test/ui/borrowck/borrowck-union-uninitialized.nll.stderr b/src/test/ui/borrowck/borrowck-union-uninitialized.nll.stderr index 49bc6d32636..94a7a4866e6 100644 --- a/src/test/ui/borrowck/borrowck-union-uninitialized.nll.stderr +++ b/src/test/ui/borrowck/borrowck-union-uninitialized.nll.stderr @@ -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`. diff --git a/src/test/ui/borrowck/borrowck-use-in-index-lvalue.ast.nll.stderr b/src/test/ui/borrowck/borrowck-use-in-index-lvalue.ast.nll.stderr index d69693eb035..502978f25be 100644 --- a/src/test/ui/borrowck/borrowck-use-in-index-lvalue.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-use-in-index-lvalue.ast.nll.stderr @@ -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] diff --git a/src/test/ui/borrowck/borrowck-use-in-index-lvalue.mir.stderr b/src/test/ui/borrowck/borrowck-use-in-index-lvalue.mir.stderr index d69693eb035..502978f25be 100644 --- a/src/test/ui/borrowck/borrowck-use-in-index-lvalue.mir.stderr +++ b/src/test/ui/borrowck/borrowck-use-in-index-lvalue.mir.stderr @@ -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] diff --git a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.nll.stderr b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.nll.stderr index b96379db650..22e95ca3ad0 100644 --- a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.nll.stderr @@ -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` diff --git a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.mir.stderr b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.mir.stderr index b96379db650..22e95ca3ad0 100644 --- a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.mir.stderr +++ b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.mir.stderr @@ -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` diff --git a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.ast.nll.stderr b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.ast.nll.stderr index 6eddbd934d5..11897f50910 100644 --- a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.ast.nll.stderr +++ b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.ast.nll.stderr @@ -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] diff --git a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.mir.stderr b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.mir.stderr index 6eddbd934d5..11897f50910 100644 --- a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.mir.stderr +++ b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.mir.stderr @@ -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] diff --git a/src/test/ui/borrowck/reassignment_immutable_fields.nll.stderr b/src/test/ui/borrowck/reassignment_immutable_fields.nll.stderr index 97f3bf5b81f..1f0938dd3d2 100644 --- a/src/test/ui/borrowck/reassignment_immutable_fields.nll.stderr +++ b/src/test/ui/borrowck/reassignment_immutable_fields.nll.stderr @@ -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`. diff --git a/src/test/ui/borrowck/reassignment_immutable_fields_overlapping.nll.stderr b/src/test/ui/borrowck/reassignment_immutable_fields_overlapping.nll.stderr index c433d6e25c9..7da9dbfc088 100644 --- a/src/test/ui/borrowck/reassignment_immutable_fields_overlapping.nll.stderr +++ b/src/test/ui/borrowck/reassignment_immutable_fields_overlapping.nll.stderr @@ -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`. diff --git a/src/test/ui/borrowck/reassignment_immutable_fields_twice.nll.stderr b/src/test/ui/borrowck/reassignment_immutable_fields_twice.nll.stderr index 2160ae20c42..96677be7241 100644 --- a/src/test/ui/borrowck/reassignment_immutable_fields_twice.nll.stderr +++ b/src/test/ui/borrowck/reassignment_immutable_fields_twice.nll.stderr @@ -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`. |
