rust-clippy/clippy_tests/examples/borrow_box.rs

25 lines
355 B
Rust
Raw Normal View History

2017-06-11 03:50:57 +00:00
#![feature(plugin)]
#![plugin(clippy)]
#![deny(borrowed_box)]
#![allow(blacklisted_name)]
#![allow(unused_variables)]
#![allow(dead_code)]
pub fn test1(foo: &mut Box<bool>) {
println!("{:?}", foo)
}
pub fn test2() {
let foo: &Box<bool>;
}
struct Test3<'a> {
foo: &'a Box<bool>
}
fn main(){
test1(&mut Box::new(false));
test2();
}