Add error explanation for E0515

This commit is contained in:
Guillaume Gomez 2015-10-06 23:08:33 +02:00
parent 8fee5480c3
commit a94f684129

View File

@ -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! {