2016-04-20 15:10:23 -05:00
|
|
|
#![feature(plugin)]
|
|
|
|
#![plugin(clippy)]
|
|
|
|
|
|
|
|
use std::sync::Arc;
|
|
|
|
|
|
|
|
use std::mem::forget as forgetSomething;
|
|
|
|
use std::mem as memstuff;
|
|
|
|
|
|
|
|
#[deny(mem_forget)]
|
|
|
|
fn main() {
|
|
|
|
let five: i32 = 5;
|
|
|
|
forgetSomething(five);
|
2016-04-20 20:55:41 -05:00
|
|
|
//~^ ERROR usage of mem::forget
|
2016-04-20 15:10:23 -05:00
|
|
|
|
|
|
|
let six: Arc<i32> = Arc::new(6);
|
|
|
|
memstuff::forget(six);
|
2016-04-20 20:55:41 -05:00
|
|
|
//~^ ERROR usage of mem::forget
|
2016-04-20 15:10:23 -05:00
|
|
|
|
|
|
|
std::mem::forget(7);
|
2016-04-20 20:55:41 -05:00
|
|
|
//~^ ERROR usage of mem::forget
|
2016-04-20 15:10:23 -05:00
|
|
|
}
|