mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 17:07:17 +00:00
Add more exhaustive tests for borrow_box
This commit is contained in:
parent
e6eaa726e2
commit
c061464f20
1 changed files with 14 additions and 3 deletions
|
@ -4,11 +4,22 @@
|
|||
#![deny(clippy)]
|
||||
#![allow(boxed_local)]
|
||||
#![allow(blacklisted_name)]
|
||||
#![allow(unused_variables)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
pub fn test(foo: &Box<bool>) { //~ ERROR you seem to be trying to use `&Box<T>`
|
||||
pub fn test1(foo: &Box<bool>) { //~ ERROR you seem to be trying to use `&Box<T>`
|
||||
println!("{:?}", foo)
|
||||
}
|
||||
|
||||
fn main(){
|
||||
test(&Box::new(false));
|
||||
pub fn test2() {
|
||||
let foo: &Box<bool>; //~ ERROR you seem to be trying to use `&Box<T>`
|
||||
}
|
||||
|
||||
struct Test3<'a> {
|
||||
foo: &'a Box<bool> //~ ERROR you seem to be trying to use `&Box<T>`
|
||||
}
|
||||
|
||||
fn main(){
|
||||
test1(&Box::new(false));
|
||||
test2();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue