Skip to content

Commit 0e36633

Browse files
committed
---
yaml --- r: 140668 b: refs/heads/try2 c: fdf601e h: refs/heads/master v: v3
1 parent 38b0b05 commit 0e36633

File tree

129 files changed

+1537
-900
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+1537
-900
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: c2bf9bf9fed8de0c399125feba8252ad263a71fc
8+
refs/heads/try2: fdf601eaf3f6fcc727819f8c0ae2b44b30770a8a
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ fn _arm_exec_compiled_test(config: config, props: TestProps,
764764
logv(config, fmt!("executing (%s) %s", config.target, cmdline));
765765
766766
// adb shell dose not forward stdout and stderr of internal result
767-
// to stdout and stderr seperately but to stdout only
767+
// to stdout and stderr separately but to stdout only
768768
let mut newargs_out = ~[];
769769
let mut newargs_err = ~[];
770770
let subargs = args.args;

branches/try2/src/libcore/at_vec.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub fn capacity<T>(v: @[T]) -> uint {
5252
* # Arguments
5353
*
5454
* * size - An initial size of the vector to reserve
55-
* * builder - A function that will construct the vector. It recieves
55+
* * builder - A function that will construct the vector. It receives
5656
* as an argument a function that will push an element
5757
* onto the vector being constructed.
5858
*/
@@ -70,7 +70,7 @@ pub fn build_sized<A>(size: uint, builder: &fn(push: &fn(v: A))) -> @[A] {
7070
*
7171
* # Arguments
7272
*
73-
* * builder - A function that will construct the vector. It recieves
73+
* * builder - A function that will construct the vector. It receives
7474
* as an argument a function that will push an element
7575
* onto the vector being constructed.
7676
*/
@@ -87,7 +87,7 @@ pub fn build<A>(builder: &fn(push: &fn(v: A))) -> @[A] {
8787
* # Arguments
8888
*
8989
* * size - An option, maybe containing initial size of the vector to reserve
90-
* * builder - A function that will construct the vector. It recieves
90+
* * builder - A function that will construct the vector. It receives
9191
* as an argument a function that will push an element
9292
* onto the vector being constructed.
9393
*/

branches/try2/src/libcore/cast.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@ pub mod rusti {
2424
}
2525

2626
/// Casts the value at `src` to U. The two types must have the same length.
27+
#[cfg(not(stage0))]
28+
pub unsafe fn transmute_copy<T, U>(src: &T) -> U {
29+
let mut dest: U = unstable::intrinsics::uninit();
30+
{
31+
let dest_ptr: *mut u8 = rusti::transmute(&mut dest);
32+
let src_ptr: *u8 = rusti::transmute(src);
33+
unstable::intrinsics::memmove64(dest_ptr,
34+
src_ptr,
35+
sys::size_of::<U>() as u64);
36+
}
37+
dest
38+
}
39+
40+
#[cfg(stage0)]
2741
pub unsafe fn transmute_copy<T, U>(src: &T) -> U {
2842
let mut dest: U = unstable::intrinsics::init();
2943
{

branches/try2/src/libcore/condition.rs

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

1313
use prelude::*;
1414
use task;
15-
use task::local_data::{local_data_pop, local_data_set};
15+
use local_data::{local_data_pop, local_data_set};
1616

1717
// helper for transmutation, shown below.
1818
type RustClosure = (int, int);
@@ -24,14 +24,14 @@ pub struct Handler<T, U> {
2424

2525
pub struct Condition<'self, T, U> {
2626
name: &'static str,
27-
key: task::local_data::LocalDataKey<'self, Handler<T, U>>
27+
key: local_data::LocalDataKey<'self, Handler<T, U>>
2828
}
2929

3030
pub impl<'self, T, U> Condition<'self, T, U> {
3131
fn trap(&'self self, h: &'self fn(T) -> U) -> Trap<'self, T, U> {
3232
unsafe {
3333
let p : *RustClosure = ::cast::transmute(&h);
34-
let prev = task::local_data::local_data_get(self.key);
34+
let prev = local_data::local_data_get(self.key);
3535
let h = @Handler { handle: *p, prev: prev };
3636
Trap { cond: self, handler: h }
3737
}

branches/try2/src/libcore/core.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ they contained the following prologue:
6060
// Don't link to core. We are core.
6161
#[no_core];
6262

63-
#[warn(vecs_implicitly_copyable)];
6463
#[deny(non_camel_case_types)];
6564
#[allow(deprecated_mutable_fields)];
6665

@@ -216,6 +215,7 @@ pub mod trie;
216215
pub mod task;
217216
pub mod comm;
218217
pub mod pipes;
218+
pub mod local_data;
219219

220220

221221
/* Runtime and platform support */

branches/try2/src/libcore/iter.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ breaking out of iteration. The adaptors in the module work with any such iterato
1717
tied to specific traits. For example:
1818
1919
~~~~
20-
use core::iter::iter_to_vec;
21-
println(iter_to_vec(|f| uint::range(0, 20, f)).to_str());
20+
println(iter::to_vec(|f| uint::range(0, 20, f)).to_str());
2221
~~~~
2322
2423
An external iterator object implementing the interface in the `iterator` module can be used as an
@@ -55,12 +54,12 @@ pub trait Times {
5554
*
5655
* ~~~
5756
* let xs = ~[1, 2, 3];
58-
* let ys = do iter_to_vec |f| { xs.each(|x| f(*x)) };
57+
* let ys = do iter::to_vec |f| { xs.each(|x| f(*x)) };
5958
* assert_eq!(xs, ys);
6059
* ~~~
6160
*/
6261
#[inline(always)]
63-
pub fn iter_to_vec<T>(iter: &fn(f: &fn(T) -> bool)) -> ~[T] {
62+
pub fn to_vec<T>(iter: &fn(f: &fn(T) -> bool)) -> ~[T] {
6463
let mut v = ~[];
6564
for iter |x| { v.push(x) }
6665
v
@@ -185,9 +184,9 @@ mod tests {
185184
use prelude::*;
186185

187186
#[test]
188-
fn test_iter_to_vec() {
187+
fn test_to_vec() {
189188
let xs = ~[1, 2, 3];
190-
let ys = do iter_to_vec |f| { xs.each(|x| f(*x)) };
189+
let ys = do to_vec |f| { xs.each(|x| f(*x)) };
191190
assert_eq!(xs, ys);
192191
}
193192

branches/try2/src/libcore/iterator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ mod tests {
378378
#[test]
379379
fn test_counter_to_vec() {
380380
let mut it = Counter::new(0, 5).take(10);
381-
let xs = iter::iter_to_vec(|f| it.advance(f));
381+
let xs = iter::to_vec(|f| it.advance(f));
382382
assert_eq!(xs, ~[0, 5, 10, 15, 20, 25, 30, 35, 40, 45]);
383383
}
384384

branches/try2/src/libcore/os.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ fn overridden_arg_key(_v: @OverriddenArgs) {}
12081208
12091209
pub fn args() -> ~[~str] {
12101210
unsafe {
1211-
match task::local_data::local_data_get(overridden_arg_key) {
1211+
match local_data::local_data_get(overridden_arg_key) {
12121212
None => real_args(),
12131213
Some(args) => copy args.val
12141214
}
@@ -1218,7 +1218,7 @@ pub fn args() -> ~[~str] {
12181218
pub fn set_args(new_args: ~[~str]) {
12191219
unsafe {
12201220
let overridden_args = @OverriddenArgs { val: copy new_args };
1221-
task::local_data::local_data_set(overridden_arg_key, overridden_args);
1221+
local_data::local_data_set(overridden_arg_key, overridden_args);
12221222
}
12231223
}
12241224

branches/try2/src/libcore/prelude.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ pub use io;
8181
pub use iter;
8282
pub use old_iter;
8383
pub use libc;
84+
pub use local_data;
8485
pub use num;
8586
pub use ops;
8687
pub use option;

branches/try2/src/libcore/rand.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -836,13 +836,13 @@ fn tls_rng_state(_v: @@mut IsaacRng) {}
836836
pub fn task_rng() -> @@mut IsaacRng {
837837
let r : Option<@@mut IsaacRng>;
838838
unsafe {
839-
r = task::local_data::local_data_get(tls_rng_state);
839+
r = local_data::local_data_get(tls_rng_state);
840840
}
841841
match r {
842842
None => {
843843
unsafe {
844844
let rng = @@mut IsaacRng::new_seeded(seed());
845-
task::local_data::local_data_set(tls_rng_state, rng);
845+
local_data::local_data_set(tls_rng_state, rng);
846846
rng
847847
}
848848
}

branches/try2/src/libcore/rt/io/extensions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! Utility mixins that apply to all Readers and Writers
1212
1313
// XXX: Not sure how this should be structured
14-
// XXX: Iteration should probably be considered seperately
14+
// XXX: Iteration should probably be considered separately
1515

1616
pub trait ReaderUtil {
1717

branches/try2/src/libcore/rt/local_services.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ mod test {
198198
199199
#[test]
200200
fn tls() {
201-
use task::local_data::*;
201+
use local_data::*;
202202
do run_in_newsched_task() {
203203
unsafe {
204204
fn key(_x: @~str) { }

branches/try2/src/libcore/task/local_data_priv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use cmp::Eq;
1515
use libc;
1616
use prelude::*;
1717
use task::rt;
18-
use task::local_data::LocalDataKey;
18+
use local_data::LocalDataKey;
1919

2020
use super::rt::rust_task;
2121
use rt::local_services::LocalStorage;
@@ -133,7 +133,7 @@ unsafe fn get_newsched_local_map(local: *mut LocalStorage) -> TaskLocalMap {
133133

134134
unsafe fn key_to_key_value<T: 'static>(key: LocalDataKey<T>) -> *libc::c_void {
135135
// Keys are closures, which are (fnptr,envptr) pairs. Use fnptr.
136-
// Use reintepret_cast -- transmute would leak (forget) the closure.
136+
// Use reinterpret_cast -- transmute would leak (forget) the closure.
137137
let pair: (*libc::c_void, *libc::c_void) = cast::transmute_copy(&key);
138138
pair.first()
139139
}

branches/try2/src/libcore/task/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ use unstable::finally::Finally;
4747
#[cfg(test)] use comm::SharedChan;
4848

4949
mod local_data_priv;
50-
pub mod local_data;
5150
pub mod rt;
5251
pub mod spawn;
5352

branches/try2/src/libcore/unstable/intrinsics.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ pub extern "rust-intrinsic" {
4444

4545
pub fn init<T>() -> T;
4646

47+
#[cfg(not(stage0))]
48+
pub unsafe fn uninit<T>() -> T;
49+
4750
pub fn forget<T>(_: T) -> ();
4851

4952
pub fn needs_drop<T>() -> bool;

0 commit comments

Comments
 (0)