mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
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
2 changed files with 10 additions and 0 deletions
|
@ -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 a new issue