test: Implement a test for the Drop trait on a generic struct. a=test-only
This commit is contained in:
parent
fc06114ddf
commit
b9f9ab8f77
1 changed files with 14 additions and 0 deletions
14
src/test/run-pass/drop-trait-generic.rs
Normal file
14
src/test/run-pass/drop-trait-generic.rs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
struct S<T> {
|
||||||
|
x: T
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T> S<T> : core::ops::Drop {
|
||||||
|
fn finalize() {
|
||||||
|
io::println("bye");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let x = S { x: 1 };
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue