]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/box_vec.rs
7d80dd86d226cc72fef8ccb39d49edb6aadbf30e
[rust.git] / tests / compile-fail / box_vec.rs
1 #![feature(plugin)]
2
3 #![plugin(clippy)]
4 #![deny(clippy)]
5
6 pub fn test(foo: Box<Vec<bool>>) { //~ ERROR You seem to be trying to use Box<Vec<T>>
7     println!("{:?}", foo.get(0))
8 }
9
10 pub fn test2(foo: Box<Fn(Vec<u32>)>) { // pass if #31 is fixed
11     foo(vec![1, 2, 3])
12 }
13
14 fn main(){
15     test(Box::new(Vec::new()));
16     test2(Box::new(|v| println!("{:?}", v)));
17 }