librustrt: fix fallout

This commit is contained in:
Jorge Aparicio 2014-12-02 14:24:40 -05:00
parent f91d87e6a0
commit 0fcd730373
2 changed files with 5 additions and 3 deletions

View File

@ -19,6 +19,7 @@
#![feature(macro_rules, phase, globs, thread_local, asm)]
#![feature(linkage, lang_items, unsafe_destructor, default_type_params)]
#![feature(import_shadowing, slicing_syntax)]
#![feature(unboxed_closures)]
#![no_std]
#![experimental]

View File

@ -22,6 +22,7 @@ use core::atomic::{AtomicUint, SeqCst};
use core::iter::{IteratorExt, Take};
use core::kinds::marker;
use core::mem;
use core::ops::FnMut;
use core::prelude::{Clone, Drop, Err, Iterator, None, Ok, Option, Send, Some};
use core::prelude::{drop};
@ -297,9 +298,9 @@ impl Task {
// `awoken` field which indicates whether we were actually woken up via some
// invocation of `reawaken`. This flag is only ever accessed inside the
// lock, so there's no need to make it atomic.
pub fn deschedule(mut self: Box<Task>,
times: uint,
f: |BlockedTask| -> ::core::result::Result<(), BlockedTask>) {
pub fn deschedule<F>(mut self: Box<Task>, times: uint, mut f: F) where
F: FnMut(BlockedTask) -> ::core::result::Result<(), BlockedTask>,
{
unsafe {
let me = &mut *self as *mut Task;
let task = BlockedTask::block(self);