Skip to content

Commit 5aa3b5c

Browse files
committed
---
yaml --- r: 96921 b: refs/heads/dist-snap c: 018d605 h: refs/heads/master i: 96919: 6e023e7 v: v3
1 parent c163c04 commit 5aa3b5c

File tree

30 files changed

+452
-591
lines changed

30 files changed

+452
-591
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: d830fcc6eb5173061888d4b128c0670a49515f58
9+
refs/heads/dist-snap: 018d60509c04cdebdf8b0d9e2b58f2604538e516
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/mk/host.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ define CP_HOST_STAGE_N
2424
# Note: $(3) and $(4) are both the same!
2525

2626
$$(HBIN$(2)_H_$(4))/rustc$$(X_$(4)): \
27-
$$(TBIN$(1)_T_$(4)_H_$(3))/rustc$$(X_$(4))
27+
$$(TBIN$(1)_T_$(4)_H_$(3))/rustc$$(X_$(4)) \
2828
$$(HLIBRUSTC_DEFAULT$(2)_H_$(4)) \
2929
| $$(HBIN$(2)_H_$(4))/
3030
@$$(call E, cp: $$@)

branches/dist-snap/mk/tests.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,13 +348,13 @@ STDTESTDEP_$(1)_$(2)_$(3) =
348348
endif
349349

350350
$(3)/stage$(1)/test/stdtest-$(2)$$(X_$(2)): \
351-
$$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
351+
$$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
352352
$$(STDTESTDEP_$(1)_$(2)_$(3))
353353
@$$(call E, compile_and_link: $$@)
354354
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
355355

356356
$(3)/stage$(1)/test/extratest-$(2)$$(X_$(2)): \
357-
$$(EXTRALIB_CRATE) $$(EXTRALIB_INPUTS) \
357+
$$(EXTRALIB_CRATE) $$(EXTRALIB_INPUTS) \
358358
$$(STDTESTDEP_$(1)_$(2)_$(3))
359359
@$$(call E, compile_and_link: $$@)
360360
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test

branches/dist-snap/src/driver/driver.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[cfg(stage0)] extern mod green;
12+
1113
#[cfg(rustpkg)]
1214
extern mod this = "rustpkg";
1315

branches/dist-snap/src/libgreen/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ pub mod sleeper_list;
5757
pub mod stack;
5858
pub mod task;
5959

60+
#[cfg(test)] mod tests;
61+
6062
#[cfg(stage0)]
6163
#[lang = "start"]
6264
pub fn lang_start(main: *u8, argc: int, argv: **u8) -> int {

branches/dist-snap/src/libnative/task.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use std::rt::task::{Task, BlockedTask};
2222
use std::rt::thread::Thread;
2323
use std::rt;
2424
use std::sync::atomics::{AtomicUint, SeqCst, INIT_ATOMIC_UINT};
25-
use std::task::TaskOpts;
25+
use std::task::{TaskOpts, default_task_opts};
2626
use std::unstable::mutex::{Mutex, MUTEX_INIT};
2727
use std::unstable::stack;
2828

@@ -73,9 +73,14 @@ pub fn new() -> ~Task {
7373
return task;
7474
}
7575

76+
/// Spawns a function with the default configuration
77+
pub fn spawn(f: proc()) {
78+
spawn_opts(default_task_opts(), f)
79+
}
80+
7681
/// Spawns a new task given the configuration options and a procedure to run
7782
/// inside the task.
78-
pub fn spawn(opts: TaskOpts, f: proc()) {
83+
pub fn spawn_opts(opts: TaskOpts, f: proc()) {
7984
// must happen before the spawn, no need to synchronize with a lock.
8085
unsafe { THREAD_CNT.fetch_add(1, SeqCst); }
8186

@@ -238,7 +243,7 @@ impl rt::Runtime for Ops {
238243
cur_task.put_runtime(self as ~rt::Runtime);
239244
Local::put(cur_task);
240245

241-
task::spawn(opts, f);
246+
task::spawn_opts(opts, f);
242247
}
243248

244249
fn local_io<'a>(&'a mut self) -> Option<rtio::LocalIo<'a>> {

branches/dist-snap/src/libstd/any.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl<'a> AnyMutRefExt<'a> for &'a mut Any {
119119
/// Extension methods for a owning `Any` trait object
120120
pub trait AnyOwnExt {
121121
/// Returns the boxed value if it is of type `T`, or
122-
/// `None` if it isn't.
122+
/// `Err(Self)` if it isn't.
123123
fn move<T: 'static>(self) -> Result<~T, Self>;
124124
}
125125

@@ -156,9 +156,8 @@ impl<'a> ToStr for &'a Any {
156156

157157
#[cfg(test)]
158158
mod tests {
159+
use prelude::*;
159160
use super::*;
160-
use super::AnyRefExt;
161-
use option::{Some, None};
162161

163162
#[deriving(Eq)]
164163
struct Test;
@@ -385,8 +384,14 @@ mod tests {
385384
let a = ~8u as ~Any;
386385
let b = ~Test as ~Any;
387386

388-
assert_eq!(a.move(), Ok(~8u));
389-
assert_eq!(b.move(), Ok(~Test));
387+
match a.move::<uint>() {
388+
Ok(a) => { assert_eq!(a, ~8u); }
389+
Err(..) => fail!()
390+
}
391+
match b.move::<Test>() {
392+
Ok(a) => { assert_eq!(a, ~Test); }
393+
Err(..) => fail!()
394+
}
390395

391396
let a = ~8u as ~Any;
392397
let b = ~Test as ~Any;

0 commit comments

Comments
 (0)