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:
parent
74ebe6e69e
commit
54b52054c9
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user