1
Fork 0

Make suggestion verbose and tweak error message

This commit is contained in:
Michael Goulet 2025-01-02 22:19:45 +00:00
parent 8e344ae127
commit 7601adb4a0
10 changed files with 178 additions and 119 deletions

View file

@ -2,37 +2,45 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
--> $DIR/suggest-array-length.rs:5:22
|
LL | const Foo: [i32; _] = [1, 2, 3];
| ------^-
| | |
| | not allowed in type signatures
| help: replace with the correct type: `[i32; 3]`
| ^ not allowed in type signatures
|
help: replace this with a fully-specified type
|
LL | const Foo: [i32; 3] = [1, 2, 3];
| ~~~~~~~~
error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
--> $DIR/suggest-array-length.rs:7:26
|
LL | const REF_FOO: &[u8; _] = &[1];
| ------^-
| | |
| | not allowed in type signatures
| help: replace with the correct type: `&[u8; 1]`
| ^ not allowed in type signatures
|
help: replace this with a fully-specified type
|
LL | const REF_FOO: &[u8; 1] = &[1];
| ~~~~~~~~
error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
--> $DIR/suggest-array-length.rs:9:26
|
LL | static Statik: [i32; _] = [1, 2, 3];
| ------^-
| | |
| | not allowed in type signatures
| help: replace with the correct type: `[i32; 3]`
| ^ not allowed in type signatures
|
help: replace this with a fully-specified type
|
LL | static Statik: [i32; 3] = [1, 2, 3];
| ~~~~~~~~
error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
--> $DIR/suggest-array-length.rs:11:30
|
LL | static REF_STATIK: &[u8; _] = &[1];
| ------^-
| | |
| | not allowed in type signatures
| help: replace with the correct type: `&[u8; 1]`
| ^ not allowed in type signatures
|
help: replace this with a fully-specified type
|
LL | static REF_STATIK: &[u8; 1] = &[1];
| ~~~~~~~~
error[E0658]: using `_` for array lengths is unstable
--> $DIR/suggest-array-length.rs:13:20