Skip to content

Commit 54b5205

Browse files
author
scott-linder
committed
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.
1 parent 74ebe6e commit 54b5205

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

clippy_tests/examples/box_vec.rs

+5
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ pub fn test2(foo: Box<Fn(Vec<u32>)>) { // pass if #31 is fixed
2222
foo(vec![1, 2, 3])
2323
}
2424

25+
pub fn test_local_not_linted() {
26+
let _: Box<Vec<bool>>;
27+
}
28+
2529
fn main(){
2630
test(Box::new(Vec::new()));
2731
test2(Box::new(|v| println!("{:?}", v)));
2832
test_macro();
33+
test_local_not_linted();
2934
}

clippy_tests/examples/dlist.rs

+5
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ pub fn test_ret() -> Option<LinkedList<u8>> {
3434
unimplemented!();
3535
}
3636

37+
pub fn test_local_not_linted() {
38+
let _: LinkedList<u8>;
39+
}
40+
3741
fn main(){
3842
test(LinkedList::new());
43+
test_local_not_linted();
3944
}

0 commit comments

Comments
 (0)