]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/range.rs
Auto merge of #3603 - xfix:random-state-lint, r=phansch
[rust.git] / tests / ui / range.rs
index d9db28c8513f4a9077bcdd710e498b500ab7b0db..1eab67e20d0f8364869187bdd17f449d035fec4a 100644 (file)
@@ -1,14 +1,18 @@
-#![feature(iterator_step_by)]
-#![feature(inclusive_range_syntax)]
-
-
+// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// 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.
 
 struct NotARange;
 impl NotARange {
     fn step_by(&self, _: u32) {}
 }
 
-#[warn(iterator_step_by_zero, range_zip_with_len)]
+#[warn(clippy::iterator_step_by_zero, clippy::range_zip_with_len)]
 fn main() {
     let _ = (0..1).step_by(0);
     // No warning for non-zero step
@@ -24,13 +28,13 @@ fn main() {
     let y = NotARange;
     y.step_by(0);
 
-    let v1 = vec![1,2,3];
-    let v2 = vec![4,5];
+    let v1 = vec![1, 2, 3];
+    let v2 = vec![4, 5];
     let _x = v1.iter().zip(0..v1.len());
     let _y = v1.iter().zip(0..v2.len()); // No error
 
     // check const eval
-    let _ = v1.iter().step_by(2/3);
+    let _ = v1.iter().step_by(2 / 3);
 }
 
 #[allow(unused)]