Skip to content

Commit 8f835d4

Browse files
committed
std: Remove get_task function. Unused
1 parent 81dda9d commit 8f835d4

File tree

4 files changed

+13
-25
lines changed

4 files changed

+13
-25
lines changed

src/libstd/task/mod.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ use result::Result;
4444
use result;
4545
use rt::{context, OldTaskContext, TaskContext};
4646
use rt::local::Local;
47-
use task::rt::task_id;
4847
use unstable::finally::Finally;
4948
use util;
5049

@@ -58,12 +57,6 @@ mod local_data_priv;
5857
pub mod rt;
5958
pub mod spawn;
6059

61-
/// A handle to a task
62-
#[deriving(Eq)]
63-
pub enum Task {
64-
TaskHandle(task_id)
65-
}
66-
6760
/**
6861
* Indicates the manner in which a task exited.
6962
*
@@ -570,14 +563,6 @@ pub fn failing() -> bool {
570563
}
571564
}
572565

573-
pub fn get_task() -> Task {
574-
//! Get a handle to the running task
575-
576-
unsafe {
577-
TaskHandle(rt::get_task_id())
578-
}
579-
}
580-
581566
/**
582567
* Temporarily make the task unkillable
583568
*

src/test/compile-fail/fully-qualified-type-name4.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111
// Test that we use fully-qualified type names in error messages.
1212

13-
use std::task::Task;
13+
use std::option::Option;
1414

15-
fn bar(x: uint) -> Task {
15+
fn bar(x: uint) -> Option<uint> {
1616
return x;
17-
//~^ ERROR mismatched types: expected `std::task::Task`
17+
//~^ ERROR mismatched types: expected `std::option::Option<uint>`
1818
}
1919

2020
fn main() {

src/test/run-pass/issue-2718.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,19 @@
1212

1313
use std::util;
1414

15+
pub type Task = int;
16+
1517
// tjc: I don't know why
1618
pub mod pipes {
19+
use super::Task;
1720
use std::cast::{forget, transmute};
1821
use std::cast;
1922
use std::task;
2023
use std::util;
2124

2225
pub struct Stuff<T> {
2326
state: state,
24-
blocked_task: Option<task::Task>,
27+
blocked_task: Option<Task>,
2528
payload: Option<T>
2629
}
2730

@@ -35,15 +38,15 @@ pub mod pipes {
3538

3639
pub struct packet<T> {
3740
state: state,
38-
blocked_task: Option<task::Task>,
41+
blocked_task: Option<Task>,
3942
payload: Option<T>
4043
}
4144

4245
pub fn packet<T:Send>() -> *packet<T> {
4346
unsafe {
4447
let p: *packet<T> = cast::transmute(~Stuff{
4548
state: empty,
46-
blocked_task: None::<task::Task>,
49+
blocked_task: None::<Task>,
4750
payload: None::<T>
4851
});
4952
p

src/test/run-pass/task-killjoin-rsrc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl Drop for notify {
2727
fn drop(&self) {
2828
unsafe {
2929
error!("notify: task=%? v=%x unwinding=%b b=%b",
30-
task::get_task(),
30+
0,
3131
ptr::to_unsafe_ptr(&(*(self.v))) as uint,
3232
task::failing(),
3333
*(self.v));
@@ -48,7 +48,7 @@ fn joinable(f: ~fn()) -> Port<bool> {
4848
fn wrapper(c: Chan<bool>, f: &fn()) {
4949
let b = @mut false;
5050
error!("wrapper: task=%? allocated v=%x",
51-
task::get_task(),
51+
0,
5252
ptr::to_unsafe_ptr(&(*b)) as uint);
5353
let _r = notify(c, b);
5454
f();
@@ -71,13 +71,13 @@ fn supervised() {
7171
// Yield to make sure the supervisor joins before we
7272
// fail. This is currently not needed because the supervisor
7373
// runs first, but I can imagine that changing.
74-
error!("supervised task=%?", task::get_task);
74+
error!("supervised task=%?", 0);
7575
task::yield();
7676
fail!();
7777
}
7878

7979
fn supervisor() {
80-
error!("supervisor task=%?", task::get_task());
80+
error!("supervisor task=%?", 0);
8181
let t = joinable(supervised);
8282
join(t);
8383
}

0 commit comments

Comments
 (0)