]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/indexing_slicing.rs
Auto merge of #3603 - xfix:random-state-lint, r=phansch
[rust.git] / tests / ui / indexing_slicing.rs
index 8d3f3cee99aa9df2ab0ef23a39fa93ea24bd6c96..a9e697e519f87e65eba863b368f91e78ac399d42 100644 (file)
@@ -7,9 +7,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![feature(tool_lints)]
-
 #![feature(plugin)]
 #![warn(clippy::indexing_slicing)]
 #![warn(clippy::out_of_bounds_indexing)]
@@ -91,4 +88,9 @@ fn main() {
     x[M]; // Ok, should not produce stderr.
     v[N];
     v[M];
+
+    // issue 3102
+    let num = 1;
+    &x[num..10]; // should trigger out of bounds error
+    &x[10..num]; // should trigger out of bounds error
 }