]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/box_vec.rs
iterate List by value
[rust.git] / tests / ui / box_vec.rs
index bc5e8361d8bc6a6e79c2d511d1c1440c0fcd4f8c..87b67c23704c9e71ba4cec847a89cef943d8498e 100644 (file)
@@ -1,6 +1,3 @@
-#![feature(tool_lints)]
-
-
 #![warn(clippy::all)]
 #![allow(clippy::boxed_local, clippy::needless_pass_by_value)]
 #![allow(clippy::blacklisted_name)]
@@ -8,7 +5,7 @@
 macro_rules! boxit {
     ($init:expr, $x:ty) => {
         let _: Box<$x> = Box::new($init);
-    }
+    };
 }
 
 fn test_macro() {
@@ -18,7 +15,8 @@ pub fn test(foo: Box<Vec<bool>>) {
     println!("{:?}", foo.get(0))
 }
 
-pub fn test2(foo: Box<Fn(Vec<u32>)>) { // pass if #31 is fixed
+pub fn test2(foo: Box<dyn Fn(Vec<u32>)>) {
+    // pass if #31 is fixed
     foo(vec![1, 2, 3])
 }
 
@@ -26,7 +24,7 @@ pub fn test_local_not_linted() {
     let _: Box<Vec<bool>>;
 }
 
-fn main(){
+fn main() {
     test(Box::new(Vec::new()));
     test2(Box::new(|v| println!("{:?}", v)));
     test_macro();