Skip to content

Commit eaec1ce

Browse files
committed
---
yaml --- r: 47377 b: refs/heads/try c: 3f91f32 h: refs/heads/master i: 47375: f87fc11 v: v3
1 parent 5cbd91a commit eaec1ce

Some content is hidden

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

68 files changed

+512
-433
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3bbcac322669cff3abde5be937cc4ec3860f3985
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
5-
refs/heads/try: 792181084244abc7ab361fd1db809c4217148304
5+
refs/heads/try: 3f91f32938358d65945e5214f664b8f0453d4a28
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ You're not off the hook even if you just stick to documentation; code examples i
1111
Pull requests will be treated as "review requests",
1212
and we will give feedback we expect to see corrected on [style](https://github.com/mozilla/rust/wiki/Note-style-guide) and substance before pulling.
1313
Changes contributed via pull request should focus on a single issue at a time, like any other.
14-
We will not look accept pull-requests that try to "sneak" unrelated changes in.
14+
We will not accept pull-requests that try to "sneak" unrelated changes in.
1515

1616
Normally, all pull requests must include regression tests (see [Note-testsuite](https://github.com/mozilla/rust/wiki/Note-testsuite)) that test your change.
1717
Occasionally, a change will be very difficult to test for.

branches/try/src/libcore/at_vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ pub mod raw {
183183
use at_vec::{capacity, rustrt};
184184
use cast::transmute;
185185
use libc;
186-
use private::intrinsics::{move_val_init};
186+
use unstable::intrinsics::{move_val_init};
187187
use ptr::addr_of;
188188
use ptr;
189189
use sys;

branches/try/src/libcore/comm.rs

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

11-
// Transitional -- needs snapshot
12-
#[allow(structural_records)];
13-
1411
use either::{Either, Left, Right};
1512
use kinds::Owned;
1613
use option;
1714
use option::{Option, Some, None, unwrap};
18-
use private;
15+
use unstable;
1916
use vec;
2017

2118
use pipes::{recv, try_recv, wait_many, peek, PacketHeader};
2219

23-
// NOTE Making this public exposes some plumbing from pipes. Needs
24-
// some refactoring
20+
// FIXME #5160: Making this public exposes some plumbing from
21+
// pipes. Needs some refactoring
2522
pub use pipes::Selectable;
2623

2724
/// A trait for things that can send multiple messages.
@@ -245,7 +242,7 @@ impl<T: Owned> Peekable<T> for PortSet<T> {
245242
}
246243
247244
/// A channel that can be shared between many senders.
248-
pub type SharedChan<T> = private::Exclusive<Chan<T>>;
245+
pub type SharedChan<T> = unstable::Exclusive<Chan<T>>;
249246
250247
impl<T: Owned> GenericChan<T> for SharedChan<T> {
251248
fn send(x: T) {
@@ -271,7 +268,7 @@ impl<T: Owned> GenericSmartChan<T> for SharedChan<T> {
271268
272269
/// Converts a `chan` into a `shared_chan`.
273270
pub fn SharedChan<T:Owned>(c: Chan<T>) -> SharedChan<T> {
274-
private::exclusive(c)
271+
unstable::exclusive(c)
275272
}
276273
277274
/// Receive a message from one of two endpoints.

branches/try/src/libcore/core.rc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -41,7 +41,7 @@ Implicitly, all crates behave as if they included the following prologue:
4141
url = "https://github.com/mozilla/rust/tree/master/src/libcore")];
4242

4343
#[comment = "The Rust core library"];
44-
#[license = "MIT"];
44+
#[license = "MIT/ASL2"];
4545
#[crate_type = "lib"];
4646

4747

@@ -227,13 +227,13 @@ pub const debug : u32 = 4_u32;
227227

228228
// The runtime interface used by the compiler
229229
#[cfg(notest)] pub mod rt;
230-
// The runtime and compiler interface to fmt!
231-
#[cfg(stage0)]
232-
#[path = "private/extfmt.rs"]
233-
pub mod extfmt;
234230
// Private APIs
235-
pub mod private;
236-
231+
pub mod unstable;
232+
// NOTE: Remove after snapshot
233+
#[cfg(stage0)]
234+
pub mod private {
235+
pub use super::unstable::extfmt;
236+
}
237237

238238
/* For internal use, not exported */
239239

branches/try/src/libcore/num/f32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use num::strconv;
1818
use num;
1919
use ops;
2020
use option::Option;
21-
use private::intrinsics::floorf32;
21+
use unstable::intrinsics::floorf32;
2222
use from_str;
2323
use to_str;
2424

branches/try/src/libcore/num/f64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use num::strconv;
1919
use num;
2020
use ops;
2121
use option::Option;
22-
use private::intrinsics::floorf64;
22+
use unstable::intrinsics::floorf64;
2323
use to_str;
2424
use from_str;
2525

branches/try/src/libcore/num/strconv.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -478,17 +478,16 @@ pub pure fn from_str_bytes_common<T:NumCast+Zero+One+Ord+Copy+Div<T,T>+
478478
}
479479
}
480480

481-
// XXX: Bytevector constant from str
482481
if special {
483-
if buf == str::to_bytes("inf") || buf == str::to_bytes("+inf") {
482+
if buf == str::inf_buf || buf == str::positive_inf_buf {
484483
return NumStrConv::inf();
485-
} else if buf == str::to_bytes("-inf") {
484+
} else if buf == str::negative_inf_buf {
486485
if negative {
487486
return NumStrConv::neg_inf();
488487
} else {
489488
return None;
490489
}
491-
} else if buf == str::to_bytes("NaN") {
490+
} else if buf == str::nan_buf {
492491
return NumStrConv::NaN();
493492
}
494493
}

branches/try/src/libcore/os.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ use libc::{mode_t, pid_t, FILE};
3535
use option;
3636
use option::{Some, None};
3737
use prelude::*;
38-
use private;
3938
use ptr;
4039
use str;
4140
use task;
@@ -145,8 +144,8 @@ This uses a per-runtime lock to serialize access.
145144
FIXME #4726: It would probably be appropriate to make this a real global
146145
*/
147146
fn with_env_lock<T>(f: &fn() -> T) -> T {
148-
use private::global::global_data_clone_create;
149-
use private::{Exclusive, exclusive};
147+
use unstable::global::global_data_clone_create;
148+
use unstable::{Exclusive, exclusive};
150149

151150
struct SharedValue(());
152151
type ValueMutex = Exclusive<SharedValue>;

branches/try/src/libcore/pipes.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ bounded and unbounded protocols allows for less code duplication.
8282
8383
*/
8484

85-
#[allow(structural_records)]; // Macros -- needs another snapshot
86-
8785
use cmp::Eq;
8886
use cast::{forget, reinterpret_cast, transmute};
8987
use cell::Cell;
@@ -93,9 +91,9 @@ use libc;
9391
use option;
9492
use option::{None, Option, Some, unwrap};
9593
use pipes;
96-
use private::intrinsics;
94+
use unstable::intrinsics;
9795
use ptr;
98-
use private;
96+
use unstable;
9997
use task;
10098
use vec;
10199

branches/try/src/libcore/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub use option;
6969
pub use os;
7070
pub use path;
7171
pub use comm;
72-
pub use private;
72+
pub use unstable;
7373
pub use ptr;
7474
pub use rand;
7575
pub use result;

branches/try/src/libcore/ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use cast;
1414
use cmp::{Eq, Ord};
1515
use libc;
1616
use libc::{c_void, size_t};
17-
use private::intrinsics::{memmove32,memmove64};
17+
use unstable::intrinsics::{memmove32,memmove64};
1818
use ptr;
1919
use str;
2020
use sys;

branches/try/src/libcore/rt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use libc::{c_char, c_uchar, c_void, size_t, uintptr_t, c_int};
1515
use managed::raw::BoxRepr;
1616
use str;
1717
use sys;
18-
use private::exchange_alloc;
18+
use unstable::exchange_alloc;
1919
use cast::transmute;
2020

2121
use gc::{cleanup_stack_for_failure, gc, Word};

branches/try/src/libcore/stackwalk.rs

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

1111
#[doc(hidden)]; // FIXME #3538
1212

13-
#[legacy_modes]; // tjc: remove after snapshot
14-
#[allow(deprecated_mode)];
15-
1613
use cast::reinterpret_cast;
1714
use ptr::offset;
1815
use sys::size_of;

branches/try/src/libcore/str.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,6 +1832,13 @@ const tag_five_b: uint = 248u;
18321832
const max_five_b: uint = 67108864u;
18331833
const tag_six_b: uint = 252u;
18341834

1835+
// Constants used for converting strs to floats
1836+
pub const inf_buf: [u8*3] = ['i' as u8, 'n' as u8, 'f' as u8];
1837+
pub const positive_inf_buf: [u8*4] = ['+' as u8, 'i' as u8,
1838+
'n' as u8, 'f' as u8];
1839+
pub const negative_inf_buf: [u8*4] = ['-' as u8, 'i' as u8,
1840+
'n' as u8, 'f' as u8];
1841+
pub const nan_buf: [u8*3] = ['N' as u8, 'a' as u8, 'N' as u8];
18351842

18361843
/**
18371844
* Work with the byte buffer of a string.

branches/try/src/libcore/task/spawn.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ use option;
7979
use comm::{Chan, GenericChan, GenericPort, Port, stream};
8080
use pipes;
8181
use prelude::*;
82-
use private;
82+
use unstable;
8383
use ptr;
8484
use hashmap::linear::LinearSet;
8585
use task::local_data_priv::{local_get, local_set};
@@ -123,7 +123,7 @@ struct TaskGroupData {
123123
// tasks in this group.
124124
mut descendants: TaskSet,
125125
}
126-
type TaskGroupArc = private::Exclusive<Option<TaskGroupData>>;
126+
type TaskGroupArc = unstable::Exclusive<Option<TaskGroupData>>;
127127

128128
type TaskGroupInner = &mut Option<TaskGroupData>;
129129

@@ -153,7 +153,7 @@ struct AncestorNode {
153153
mut ancestors: AncestorList,
154154
}
155155

156-
enum AncestorList = Option<private::Exclusive<AncestorNode>>;
156+
enum AncestorList = Option<unstable::Exclusive<AncestorNode>>;
157157

158158
// Accessors for taskgroup arcs and ancestor arcs that wrap the unsafety.
159159
#[inline(always)]
@@ -162,7 +162,7 @@ fn access_group<U>(x: &TaskGroupArc, blk: fn(TaskGroupInner) -> U) -> U {
162162
}
163163

164164
#[inline(always)]
165-
fn access_ancestors<U>(x: &private::Exclusive<AncestorNode>,
165+
fn access_ancestors<U>(x: &unstable::Exclusive<AncestorNode>,
166166
blk: fn(x: &mut AncestorNode) -> U) -> U {
167167
unsafe { x.with(blk) }
168168
}
@@ -458,7 +458,7 @@ fn gen_child_taskgroup(linked: bool, supervised: bool)
458458
// Main task, doing first spawn ever. Lazily initialise here.
459459
let mut members = new_taskset();
460460
taskset_insert(&mut members, spawner);
461-
let tasks = private::exclusive(Some(TaskGroupData {
461+
let tasks = unstable::exclusive(Some(TaskGroupData {
462462
members: members,
463463
descendants: new_taskset(),
464464
}));
@@ -482,7 +482,7 @@ fn gen_child_taskgroup(linked: bool, supervised: bool)
482482
(g, a, spawner_group.is_main)
483483
} else {
484484
// Child is in a separate group from spawner.
485-
let g = private::exclusive(Some(TaskGroupData {
485+
let g = unstable::exclusive(Some(TaskGroupData {
486486
members: new_taskset(),
487487
descendants: new_taskset(),
488488
}));
@@ -502,7 +502,7 @@ fn gen_child_taskgroup(linked: bool, supervised: bool)
502502
};
503503
assert new_generation < uint::max_value;
504504
// Build a new node in the ancestor list.
505-
AncestorList(Some(private::exclusive(AncestorNode {
505+
AncestorList(Some(unstable::exclusive(AncestorNode {
506506
generation: new_generation,
507507
parent_group: Some(spawner_group.tasks.clone()),
508508
ancestors: old_ancestors,

branches/try/src/libcore/private.rs renamed to branches/try/src/libcore/unstable.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ use task;
2222
use task::{TaskBuilder, atomically};
2323
use uint;
2424

25-
#[path = "private/at_exit.rs"]
25+
#[path = "unstable/at_exit.rs"]
2626
pub mod at_exit;
27-
#[path = "private/global.rs"]
27+
#[path = "unstable/global.rs"]
2828
pub mod global;
29-
#[path = "private/finally.rs"]
29+
#[path = "unstable/finally.rs"]
3030
pub mod finally;
31-
#[path = "private/weak_task.rs"]
31+
#[path = "unstable/weak_task.rs"]
3232
pub mod weak_task;
33-
#[path = "private/exchange_alloc.rs"]
33+
#[path = "unstable/exchange_alloc.rs"]
3434
pub mod exchange_alloc;
35-
#[path = "private/intrinsics.rs"]
35+
#[path = "unstable/intrinsics.rs"]
3636
pub mod intrinsics;
37-
#[path = "private/extfmt.rs"]
37+
#[path = "unstable/extfmt.rs"]
3838
pub mod extfmt;
3939

4040
extern mod rustrt {
@@ -312,7 +312,7 @@ pub mod tests {
312312
use cell::Cell;
313313
use comm;
314314
use option;
315-
use private::exclusive;
315+
use super::exclusive;
316316
use result;
317317
use task;
318318
use uint;

branches/try/src/libcore/private/exchange_alloc.rs renamed to branches/try/src/libcore/unstable/exchange_alloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use c_malloc = libc::malloc;
1414
use c_free = libc::free;
1515
use managed::raw::{BoxHeaderRepr, BoxRepr};
1616
use cast::transmute;
17-
use private::intrinsics::{atomic_xadd,atomic_xsub};
17+
use unstable::intrinsics::{atomic_xadd,atomic_xsub};
1818
use ptr::null;
1919
use intrinsic::TyDesc;
2020

branches/try/src/libcore/private/finally.rs renamed to branches/try/src/libcore/unstable/finally.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,10 @@ do || {
2626
use ops::Drop;
2727
use task::{spawn, failing};
2828

29-
#[cfg(stage0)]
30-
pub trait Finally<T> {
31-
fn finally(&self, +dtor: &fn()) -> T;
32-
}
33-
34-
#[cfg(stage1)]
35-
#[cfg(stage2)]
36-
#[cfg(stage3)]
3729
pub trait Finally<T> {
3830
fn finally(&self, dtor: &fn()) -> T;
3931
}
4032

41-
#[cfg(stage0)]
42-
impl<T> Finally<T> for &fn() -> T {
43-
// FIXME #4518: Should not require a mode here
44-
fn finally(&self, +dtor: &fn()) -> T {
45-
let _d = Finallyalizer {
46-
dtor: dtor
47-
};
48-
49-
(*self)()
50-
}
51-
}
52-
53-
#[cfg(stage1)]
54-
#[cfg(stage2)]
55-
#[cfg(stage3)]
5633
impl<T> Finally<T> for &fn() -> T {
5734
fn finally(&self, dtor: &fn()) -> T {
5835
let _d = Finallyalizer {

branches/try/src/libcore/private/global.rs renamed to branches/try/src/libcore/unstable/global.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ use libc::{c_void, uintptr_t};
3232
use option::{Option, Some, None};
3333
use ops::Drop;
3434
use pipes;
35-
use private::{Exclusive, exclusive};
36-
use private::{SharedMutableState, shared_mutable_state};
37-
use private::{get_shared_immutable_state};
38-
use private::at_exit::at_exit;
39-
use private::intrinsics::atomic_cxchg;
35+
use unstable::{Exclusive, exclusive};
36+
use unstable::{SharedMutableState, shared_mutable_state};
37+
use unstable::{get_shared_immutable_state};
38+
use unstable::at_exit::at_exit;
39+
use unstable::intrinsics::atomic_cxchg;
4040
use hashmap::linear::LinearMap;
4141
use sys::Closure;
4242
use task::spawn;

0 commit comments

Comments
 (0)