Skip to content

Commit 24f7bc7

Browse files
committed
---
yaml --- r: 4897 b: refs/heads/master c: 55c54f0 h: refs/heads/master i: 4895: 86c9fe5 v: v3
1 parent 27dacd6 commit 24f7bc7

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: d6e4fa6b449e7226438d4645fb4c21fa1dc46479
2+
refs/heads/master: 55c54f0db5be696be4b27cc23e5948f8eb3acd86

trunk/src/lib/task.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ native "rust" mod rustrt {
2525
fn get_task_trampoline() -> u32;
2626

2727
fn migrate_alloc(alloc: *u8, target: task_id);
28-
29-
fn leak<@T>(thing: -T);
3028
}
3129

3230
type rust_task =
@@ -149,7 +147,7 @@ fn spawn_inner(thunk: -fn(), notify: option<comm::chan<task_notification>>) ->
149147
rustrt::migrate_alloc(cast(raw_thunk.env), id);
150148
rustrt::start_task(id);
151149

152-
rustrt::leak(thunk);
150+
unsafe::leak(thunk);
153151

154152
ret id;
155153
}

trunk/src/lib/unsafe.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ native "rust-intrinsic" mod rusti {
44
fn cast<T, U>(src: &T) -> U;
55
}
66

7+
native "rust" mod rustrt {
8+
fn leak<@T>(thing: -T);
9+
}
10+
711
// Casts the value at `src` to U. The two types must have the same length.
812
fn reinterpret_cast<T, U>(src: &T) -> U { ret rusti::cast(src); }
913

14+
fn leak<@T>(thing: -T) {
15+
rustrt::leak(thing);
16+
}

0 commit comments

Comments
 (0)