rust/tests/compile-fail/mem_forget.rs
2016-04-20 18:55:41 -07:00

22 lines
412 B
Rust

#![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);
//~^ ERROR usage of mem::forget
let six: Arc<i32> = Arc::new(6);
memstuff::forget(six);
//~^ ERROR usage of mem::forget
std::mem::forget(7);
//~^ ERROR usage of mem::forget
}