]> git.lizzy.rs Git - rust.git/blob - src/test/ui/did_you_mean/issue-87830-try-brackets-for-arrays.stderr
Test `expect` with `forbid` and fix doc errors (RFC-2383)
[rust.git] / src / test / ui / did_you_mean / issue-87830-try-brackets-for-arrays.stderr
1 error: this code is interpreted as a block expression, not an array
2   --> $DIR/issue-87830-try-brackets-for-arrays.rs:3:22
3    |
4 LL |   const FOO: [u8; 3] = {
5    |  ______________________^
6 LL | |     1, 2, 3
7 LL | | };
8    | |_^
9    |
10    = note: to define an array, one would use square brackets instead of curly braces
11 help: try using [] instead of {}
12    |
13 LL ~ const FOO: [u8; 3] = [
14 LL |     1, 2, 3
15 LL ~ ];
16    |
17
18 error: this code is interpreted as a block expression, not an array
19   --> $DIR/issue-87830-try-brackets-for-arrays.rs:7:24
20    |
21 LL | const BAR: [&str; 3] = {"one", "two", "three"};
22    |                        ^^^^^^^^^^^^^^^^^^^^^^^
23    |
24    = note: to define an array, one would use square brackets instead of curly braces
25 help: try using [] instead of {}
26    |
27 LL | const BAR: [&str; 3] = ["one", "two", "three"];
28    |                        ~                     ~
29
30 error: this code is interpreted as a block expression, not an array
31   --> $DIR/issue-87830-try-brackets-for-arrays.rs:11:5
32    |
33 LL |     {1, 2, 3};
34    |     ^^^^^^^^^
35    |
36    = note: to define an array, one would use square brackets instead of curly braces
37 help: try using [] instead of {}
38    |
39 LL |     [1, 2, 3];
40    |     ~       ~
41
42 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `,`
43   --> $DIR/issue-87830-try-brackets-for-arrays.rs:16:6
44    |
45 LL |     1, 2, 3
46    |      ^ expected one of `.`, `;`, `?`, `}`, or an operator
47
48 error: aborting due to 4 previous errors
49