Skip to content

Commit 4d076ac

Browse files
author
scott-linder
committed
Add more exhaustive tests for borrow_box
1 parent 216f5f7 commit 4d076ac

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tests/compile-fail/borrow_box.rs

+13-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,22 @@
44
#![deny(clippy)]
55
#![allow(boxed_local)]
66
#![allow(blacklisted_name)]
7+
#![allow(unused_variables)]
8+
#![allow(dead_code)]
79

8-
pub fn test(foo: &Box<bool>) { //~ ERROR you seem to be trying to use `&Box<T>`
10+
pub fn test1(foo: &Box<bool>) { //~ ERROR you seem to be trying to use `&Box<T>`
911
println!("{:?}", foo)
1012
}
1113

14+
pub fn test2() {
15+
let foo: &Box<bool>; //~ ERROR you seem to be trying to use `&Box<T>`
16+
}
17+
18+
struct Test3<'a> {
19+
foo: &'a Box<bool> //~ ERROR you seem to be trying to use `&Box<T>`
20+
}
21+
1222
fn main(){
13-
test(&Box::new(false));
23+
test1(&Box::new(false));
24+
test2();
1425
}

0 commit comments

Comments
 (0)