about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2015-10-06 23:08:33 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2015-10-07 10:25:46 +0200
commita94f684129dbf8cb4c87abe69ff45765cf24e501 (patch)
tree0a9064a3462e95b314d73ba14ece60afccd34e5f /src
parent8fee5480c34f97a1b970a44758c6617d293724e8 (diff)
downloadrust-a94f684129dbf8cb4c87abe69ff45765cf24e501.tar.gz
rust-a94f684129dbf8cb4c87abe69ff45765cf24e501.zip
Add error explanation for E0515
Diffstat (limited to 'src')
-rw-r--r--src/librustc_trans/diagnostics.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/librustc_trans/diagnostics.rs b/src/librustc_trans/diagnostics.rs
index dd7c3834e56..05236a7a6fb 100644
--- a/src/librustc_trans/diagnostics.rs
+++ b/src/librustc_trans/diagnostics.rs
@@ -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! {