21eff8f050
Newcomers may write `{1, 2, 3}` for making arrays, and the current error message is not informative enough to quickly convince them what is needed to fix the error. This PR implements a diagnostic for this case, and its output looks like this: ```text error: this code is interpreted as a block expression, not an array --> src/lib.rs:1:22 | 1 | const FOO: [u8; 3] = { | ______________________^ 2 | | 1, 2, 3 3 | | }; | |_^ | = note: to define an array, one would use square brackets instead of curly braces help: try using [] instead of {} | 1 | const FOO: [u8; 3] = [ 2 | 1, 2, 3 3 | ]; | ``` Fix #87672 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |