Skip to content

Commit 3b554c1

Browse files
author
Elliott Slaughter
committed
rt: Add tests for box annihilator.
1 parent f022f56 commit 3b554c1

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
extern mod rustrt {
2+
fn rust_annihilate_box(ptr: *uint);
3+
}
4+
5+
fn main() {
6+
unsafe {
7+
let x = @3;
8+
let p: *uint = unsafe::transmute(x);
9+
rustrt::rust_annihilate_box(p);
10+
}
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
extern mod rustrt {
2+
fn rust_annihilate_box(ptr: *uint);
3+
}
4+
5+
fn main() {
6+
unsafe {
7+
let x = ~[~"a", ~"b", ~"c"];
8+
let p: *uint = unsafe::transmute(x);
9+
rustrt::rust_annihilate_box(p);
10+
}
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
extern mod rustrt {
2+
fn rust_annihilate_box(ptr: *uint);
3+
}
4+
5+
fn main() {
6+
unsafe {
7+
let x = ~3;
8+
let p: *uint = unsafe::transmute(x);
9+
rustrt::rust_annihilate_box(p);
10+
}
11+
}

0 commit comments

Comments
 (0)