Test for local types in LINKEDLIST and BOX_VEC

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.
This commit is contained in:
scott-linder 2017-06-11 12:30:48 -04:00
parent 74ebe6e69e
commit 54b52054c9
2 changed files with 10 additions and 0 deletions

View 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();
}

View 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();
}