about summary refs log tree commit diff
path: root/src/test/compile-fail
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2017-10-09 14:45:41 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2017-10-09 14:45:41 +0200
commita28b2465d366c0169aedf76ed932dc695d0ff049 (patch)
treec85f18971cfc1bf615c3379a8fda56a368d5649d /src/test/compile-fail
parentb2f67c8d5676d13d83523316ac95a7056dbd19c6 (diff)
downloadrust-a28b2465d366c0169aedf76ed932dc695d0ff049.tar.gz
rust-a28b2465d366c0169aedf76ed932dc695d0ff049.zip
usize index message for vec
Diffstat (limited to 'src/test/compile-fail')
-rw-r--r--src/test/compile-fail/index-help.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/compile-fail/index-help.rs b/src/test/compile-fail/index-help.rs
new file mode 100644
index 00000000000..2d37fc79250
--- /dev/null
+++ b/src/test/compile-fail/index-help.rs
@@ -0,0 +1,15 @@
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main() {
+    let x = vec![1];
+    x[0i32]; //~ ERROR E0277
+             //~| NOTE vector indices are of type `usize` or ranges of `usize`
+}