Add error explanation for E0515
This commit is contained in:
parent
8fee5480c3
commit
a94f684129
@ -12,6 +12,21 @@
|
||||
|
||||
register_long_diagnostics! {
|
||||
|
||||
E0515: r##"
|
||||
A constant index expression was out of bounds. Erroneous code example:
|
||||
|
||||
```
|
||||
let x = &[0, 1, 2][7]; // error: const index-expr is out of bounds
|
||||
```
|
||||
|
||||
Please specify a valid index (not inferior to 0 or superior to array length).
|
||||
Example:
|
||||
|
||||
```
|
||||
let x = &[0, 1, 2][2]; // ok!
|
||||
```
|
||||
"##,
|
||||
|
||||
}
|
||||
|
||||
register_diagnostics! {
|
||||
|
Loading…
Reference in New Issue
Block a user