]> git.lizzy.rs Git - rust.git/commitdiff
Test for local types in `LINKEDLIST` and `BOX_VEC`
authorscott-linder <scott.b.linder@wmich.edu>
Sun, 11 Jun 2017 16:30:48 +0000 (12:30 -0400)
committerscott-linder <scott.b.linder@wmich.edu>
Sun, 11 Jun 2017 16:30:48 +0000 (12:30 -0400)
Add negative tests for types in local declarations in the `LINKEDLIST`
and `BOX_VEC` lints. They share a pass with `BORROWED_BOX` which does
check local delclarations.

clippy_tests/examples/box_vec.rs
clippy_tests/examples/dlist.rs

index 507d9e77da0356a383d030ca9504e7507fb300dd..f8c5a80c59dec3be92348ddbe4f727ddaaa02550 100644 (file)
@@ -22,8 +22,13 @@ pub fn test2(foo: Box<Fn(Vec<u32>)>) { // pass if #31 is fixed
     foo(vec![1, 2, 3])
 }
 
+pub fn test_local_not_linted() {
+    let _: Box<Vec<bool>>;
+}
+
 fn main(){
     test(Box::new(Vec::new()));
     test2(Box::new(|v| println!("{:?}", v)));
     test_macro();
+    test_local_not_linted();
 }
index a41bf1b52e012b56b08931f1bf890663fc915cad..b23aeb70a63376dbbae181d6c7ae27fd4dc75f67 100644 (file)
@@ -34,6 +34,11 @@ pub fn test_ret() -> Option<LinkedList<u8>> {
     unimplemented!();
 }
 
+pub fn test_local_not_linted() {
+    let _: LinkedList<u8>;
+}
+
 fn main(){
     test(LinkedList::new());
+    test_local_not_linted();
 }