diff options
| author | Takayuki Maeda <takoyaki0316@gmail.com> | 2022-09-07 02:37:18 +0900 |
|---|---|---|
| committer | Takayuki Maeda <takoyaki0316@gmail.com> | 2022-09-07 02:37:18 +0900 |
| commit | 1e384423a9cfd678f976cf0183c81a770da2a325 (patch) | |
| tree | 2cbd912b16f1b68b156f561906665ae88f4b4754 /src/test/ui/array-slice-vec/suggest-array-length.stderr | |
| parent | b44197abb0b3ffe4908892e1e08ab1cd721ff3b9 (diff) | |
| download | rust-1e384423a9cfd678f976cf0183c81a770da2a325.tar.gz rust-1e384423a9cfd678f976cf0183c81a770da2a325.zip | |
suggest adding array lengths to references to arrays
Diffstat (limited to 'src/test/ui/array-slice-vec/suggest-array-length.stderr')
| -rw-r--r-- | src/test/ui/array-slice-vec/suggest-array-length.stderr | 70 |
1 files changed, 65 insertions, 5 deletions
diff --git a/src/test/ui/array-slice-vec/suggest-array-length.stderr b/src/test/ui/array-slice-vec/suggest-array-length.stderr index 9000f716028..16c90a04784 100644 --- a/src/test/ui/array-slice-vec/suggest-array-length.stderr +++ b/src/test/ui/array-slice-vec/suggest-array-length.stderr @@ -1,21 +1,45 @@ error: in expressions, `_` can only be used on the left-hand side of an assignment - --> $DIR/suggest-array-length.rs:8:20 + --> $DIR/suggest-array-length.rs:11:20 | LL | let foo: [i32; _] = [1, 2, 3]; | ^ `_` not allowed here error: in expressions, `_` can only be used on the left-hand side of an assignment - --> $DIR/suggest-array-length.rs:11:20 + --> $DIR/suggest-array-length.rs:14:20 | LL | let bar: [i32; _] = [0; 3]; | ^ `_` not allowed here error: in expressions, `_` can only be used on the left-hand side of an assignment + --> $DIR/suggest-array-length.rs:17:25 + | +LL | let ref_foo: &[i32; _] = &[1, 2, 3]; + | ^ `_` not allowed here + +error: in expressions, `_` can only be used on the left-hand side of an assignment + --> $DIR/suggest-array-length.rs:20:25 + | +LL | let ref_bar: &[i32; _] = &[0; 3]; + | ^ `_` not allowed here + +error: in expressions, `_` can only be used on the left-hand side of an assignment + --> $DIR/suggest-array-length.rs:23:35 + | +LL | let multiple_ref_foo: &&[i32; _] = &&[1, 2, 3]; + | ^ `_` not allowed here + +error: in expressions, `_` can only be used on the left-hand side of an assignment --> $DIR/suggest-array-length.rs:5:22 | LL | const Foo: [i32; _] = [1, 2, 3]; | ^ `_` not allowed here +error: in expressions, `_` can only be used on the left-hand side of an assignment + --> $DIR/suggest-array-length.rs:8:26 + | +LL | const REF_FOO: &[u8; _] = &[1]; + | ^ `_` not allowed here + error[E0658]: using `_` for array lengths is unstable --> $DIR/suggest-array-length.rs:5:22 | @@ -26,7 +50,16 @@ LL | const Foo: [i32; _] = [1, 2, 3]; = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable error[E0658]: using `_` for array lengths is unstable - --> $DIR/suggest-array-length.rs:8:20 + --> $DIR/suggest-array-length.rs:8:26 + | +LL | const REF_FOO: &[u8; _] = &[1]; + | ^ help: consider specifying the array length: `1` + | + = note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information + = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable + +error[E0658]: using `_` for array lengths is unstable + --> $DIR/suggest-array-length.rs:11:20 | LL | let foo: [i32; _] = [1, 2, 3]; | ^ help: consider specifying the array length: `3` @@ -35,7 +68,7 @@ LL | let foo: [i32; _] = [1, 2, 3]; = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable error[E0658]: using `_` for array lengths is unstable - --> $DIR/suggest-array-length.rs:11:20 + --> $DIR/suggest-array-length.rs:14:20 | LL | let bar: [i32; _] = [0; 3]; | ^ help: consider specifying the array length: `3` @@ -43,6 +76,33 @@ LL | let bar: [i32; _] = [0; 3]; = note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable -error: aborting due to 6 previous errors +error[E0658]: using `_` for array lengths is unstable + --> $DIR/suggest-array-length.rs:17:25 + | +LL | let ref_foo: &[i32; _] = &[1, 2, 3]; + | ^ help: consider specifying the array length: `3` + | + = note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information + = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable + +error[E0658]: using `_` for array lengths is unstable + --> $DIR/suggest-array-length.rs:20:25 + | +LL | let ref_bar: &[i32; _] = &[0; 3]; + | ^ help: consider specifying the array length: `3` + | + = note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information + = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable + +error[E0658]: using `_` for array lengths is unstable + --> $DIR/suggest-array-length.rs:23:35 + | +LL | let multiple_ref_foo: &&[i32; _] = &&[1, 2, 3]; + | ^ help: consider specifying the array length: `3` + | + = note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information + = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable + +error: aborting due to 14 previous errors For more information about this error, try `rustc --explain E0658`. |
