Skip to content

Commit 0fcd730

Browse files
author
Jorge Aparicio
committed
librustrt: fix fallout
1 parent f91d87e commit 0fcd730

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/librustrt/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#![feature(macro_rules, phase, globs, thread_local, asm)]
2020
#![feature(linkage, lang_items, unsafe_destructor, default_type_params)]
2121
#![feature(import_shadowing, slicing_syntax)]
22+
#![feature(unboxed_closures)]
2223
#![no_std]
2324
#![experimental]
2425

src/librustrt/task.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use core::atomic::{AtomicUint, SeqCst};
2222
use core::iter::{IteratorExt, Take};
2323
use core::kinds::marker;
2424
use core::mem;
25+
use core::ops::FnMut;
2526
use core::prelude::{Clone, Drop, Err, Iterator, None, Ok, Option, Send, Some};
2627
use core::prelude::{drop};
2728

@@ -297,9 +298,9 @@ impl Task {
297298
// `awoken` field which indicates whether we were actually woken up via some
298299
// invocation of `reawaken`. This flag is only ever accessed inside the
299300
// lock, so there's no need to make it atomic.
300-
pub fn deschedule(mut self: Box<Task>,
301-
times: uint,
302-
f: |BlockedTask| -> ::core::result::Result<(), BlockedTask>) {
301+
pub fn deschedule<F>(mut self: Box<Task>, times: uint, mut f: F) where
302+
F: FnMut(BlockedTask) -> ::core::result::Result<(), BlockedTask>,
303+
{
303304
unsafe {
304305
let me = &mut *self as *mut Task;
305306
let task = BlockedTask::block(self);

0 commit comments

Comments
 (0)