rust/tests/ui/drop/drop-trait-generic.rs

16 lines
197 B
Rust
Raw Normal View History

// run-pass
#![allow(dead_code)]
struct S<T> {
x: T
}
impl<T> ::std::ops::Drop for S<T> {
2013-09-16 21:18:07 -04:00
fn drop(&mut self) {
println!("bye");
}
}
pub fn main() {
2015-01-25 22:05:03 +01:00
let _x = S { x: 1 };
}