Skip to content

Commit

Permalink
auto merge of #10679 : alexcrichton/rust/no-routine, r=pcwalton
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Nov 27, 2013
2 parents fb52956 + 7dcc066 commit 82d9033
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 50 deletions.
26 changes: 5 additions & 21 deletions src/libextra/c_vec.rs
Expand Up @@ -37,7 +37,6 @@
*/

use std::ptr;
use std::routine::Runnable;
use std::util;

/**
Expand All @@ -50,7 +49,7 @@ pub struct CVec<T> {
}

struct DtorRes {
dtor: Option<~Runnable>,
dtor: Option<proc()>,
}

#[unsafe_destructor]
Expand All @@ -59,13 +58,13 @@ impl Drop for DtorRes {
let dtor = util::replace(&mut self.dtor, None);
match dtor {
None => (),
Some(f) => f.run()
Some(f) => f()
}
}
}

impl DtorRes {
fn new(dtor: Option<~Runnable>) -> DtorRes {
fn new(dtor: Option<proc()>) -> DtorRes {
DtorRes {
dtor: dtor,
}
Expand Down Expand Up @@ -103,7 +102,7 @@ pub unsafe fn CVec<T>(base: *mut T, len: uint) -> CVec<T> {
* * dtor - A function to run when the value is destructed, useful
* for freeing the buffer, etc.
*/
pub unsafe fn c_vec_with_dtor<T>(base: *mut T, len: uint, dtor: ~Runnable)
pub unsafe fn c_vec_with_dtor<T>(base: *mut T, len: uint, dtor: proc())
-> CVec<T> {
return CVec{
base: base,
Expand Down Expand Up @@ -155,19 +154,6 @@ mod tests {

use std::libc::*;
use std::libc;
use std::routine::Runnable;

struct LibcFree {
mem: *c_void,
}

impl Runnable for LibcFree {
fn run(~self) {
unsafe {
libc::free(self.mem)
}
}
}

fn malloc(n: size_t) -> CVec<u8> {
unsafe {
Expand All @@ -177,9 +163,7 @@ mod tests {

return c_vec_with_dtor(mem as *mut u8,
n as uint,
~LibcFree {
mem: mem,
} as ~Runnable);
proc() unsafe { libc::free(mem); });
}
}

Expand Down
1 change: 0 additions & 1 deletion src/libstd/lib.rs
Expand Up @@ -192,7 +192,6 @@ pub mod reflect;
pub mod condition;
pub mod logging;
pub mod util;
pub mod routine;
pub mod mem;


Expand Down
28 changes: 0 additions & 28 deletions src/libstd/routine.rs

This file was deleted.

0 comments on commit 82d9033

Please sign in to comment.