Skip to content

Commit 8d2ac8c

Browse files
committed
---
yaml --- r: 100875 b: refs/heads/snap-stage3 c: 58a2b7d h: refs/heads/master i: 100873: 5ef7a33 100871: 0c9f6ef v: v3
1 parent fb77a2a commit 8d2ac8c

File tree

23 files changed

+337
-234
lines changed

23 files changed

+337
-234
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: e3b1f3c443c048913e2d573fcc5a9c2be3484a78
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 0ba6d4885fc71ca7156e1fe689edb939e1d9d418
4+
refs/heads/snap-stage3: 58a2b7da077b0372e4a06cdf55d1fe08800fbfec
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/mk/main.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ CFG_VERSION_WIN = $(subst -pre,,$(CFG_RELEASE))
4545
# and include all of the .d files in one fell swoop.
4646
ALL_OBJ_FILES :=
4747

48-
ifneq ($(NO_MKFILE_DEPS),)
48+
ifneq ($(NO_MAKEFILE_DEPS),)
4949
MKFILE_DEPS :=
5050
else
5151
MKFILE_DEPS := config.stamp $(call rwildcard,$(CFG_SRC_DIR)mk/,*)

branches/snap-stage3/mk/tests.mk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,16 @@ endif
174174
check: cleantestlibs cleantmptestlogs tidy all check-stage2
175175
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
176176

177+
check-notidy: cleantestlibs cleantmptestlogs all check-stage2
178+
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
179+
180+
check-full: cleantestlibs cleantmptestlogs tidy \
181+
all check-stage1 check-stage2 check-stage3
182+
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
183+
184+
check-test: cleantestlibs cleantmptestlogs all check-stage2-rfail
185+
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
186+
177187
check-lite: cleantestlibs cleantmptestlogs \
178188
$(foreach crate,$(TARGET_CRATES),check-stage2-$(crate)) \
179189
check-stage2-rpass \

branches/snap-stage3/src/doc/index.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,24 @@ li {list-style-type: none; }
2424

2525
# Libraries
2626

27-
* [The standard library, `libstd`](std/index.html)
28-
* [The extra library, `libextra`](extra/index.html)
29-
30-
* [The M:N runtime library, `libgreen`](green/index.html)
31-
* [The 1:1 runtime library, `libnative`](native/index.html)
32-
33-
* [The Rust libuv library, `librustuv`](rustuv/index.html)
34-
35-
* [The Rust parser, `libsyntax`](syntax/index.html)
36-
* [The Rust compiler, `librustc`](rustc/index.html)
27+
* [The standard library, `std`](std/index.html)
3728

3829
* [The `arena` allocation library](arena/index.html)
39-
* [The `num` arbitrary precision numerics library](num/index.html)
4030
* [The `collections` library](collections/index.html)
31+
* [The `extra` library of extra stuff](extra/index.html)
4132
* [The `flate` compression library](flate/index.html)
4233
* [The `fourcc` four-character code library](fourcc/index.html)
4334
* [The `getopts` argument parsing library](getopts/index.html)
4435
* [The `glob` file path matching library](glob/index.html)
36+
* [The `green` M:N runtime library](green/index.html)
37+
* [The `native` 1:1 threading runtime](native/index.html)
38+
* [The `num` arbitrary precision numerics library](num/index.html)
39+
* [The `rustc` compiler](rustc/index.html)
40+
* [The `rustuv` M:N I/O library](rustuv/index.html)
4541
* [The `semver` version collation library](semver/index.html)
4642
* [The `serialize` value encoding/decoding library](serialize/index.html)
4743
* [The `sync` library for concurrency-enabled mechanisms and primitives](sync/index.html)
44+
* [The `syntax` library, the Rust parser](syntax/index.html)
4845
* [The `term` terminal-handling library](term/index.html)
4946
* [The `uuid` 128-bit universally unique identifier library](uuid/index.html)
5047

branches/snap-stage3/src/etc/vim/syntax/rust.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,13 @@ syn keyword rustTrait Buffer Writer Reader Seek
9595
syn keyword rustTrait Str StrVector StrSlice OwnedStr IntoMaybeOwned
9696
syn keyword rustTrait IterBytes
9797
syn keyword rustTrait ToStr IntoStr
98+
syn keyword rustTrait CloneableTuple ImmutableTuple
9899
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
99100
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
100101
syn keyword rustTrait Tuple9 Tuple10 Tuple11 Tuple12
102+
syn keyword rustTrait ImmutableTuple1 ImmutableTuple2 ImmutableTuple3 ImmutableTuple4
103+
syn keyword rustTrait ImmutableTuple5 ImmutableTuple6 ImmutableTuple7 ImmutableTuple8
104+
syn keyword rustTrait ImmutableTuple9 ImmutableTuple10 ImmutableTuple11 ImmutableTuple12
101105
syn keyword rustTrait ImmutableEqVector ImmutableTotalOrdVector ImmutableCloneableVector
102106
syn keyword rustTrait OwnedVector OwnedCloneableVector OwnedEqVector MutableVector
103107
syn keyword rustTrait Vector VectorVector CloneableVector ImmutableVector

branches/snap-stage3/src/libcollections/btree.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,15 +500,15 @@ impl<K: Clone + TotalOrd, V: Clone> Branch<K, V> {
500500
let new_outcome = self.clone().rightmost_child.insert(k.clone(),
501501
v.clone(),
502502
ub.clone());
503-
new_branch = new_outcome.clone().val0();
504-
outcome = new_outcome.val1();
503+
new_branch = new_outcome.clone().n0();
504+
outcome = new_outcome.n1();
505505
}
506506
else {
507507
let new_outcome = self.clone().elts[index.unwrap()].left.insert(k.clone(),
508508
v.clone(),
509509
ub.clone());
510-
new_branch = new_outcome.clone().val0();
511-
outcome = new_outcome.val1();
510+
new_branch = new_outcome.clone().n0();
511+
outcome = new_outcome.n1();
512512
}
513513
//Check to see whether a branch or a leaf was returned from the
514514
//tree traversal.

branches/snap-stage3/src/libnative/io/process.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ fn with_envp<T>(env: Option<~[(~str, ~str)]>, cb: |*c_void| -> T) -> T {
529529
let mut tmps = vec::with_capacity(env.len());
530530

531531
for pair in env.iter() {
532-
let kv = format!("{}={}", *pair.ref0(), *pair.ref1());
532+
let kv = format!("{}={}", pair.first(), pair.second());
533533
tmps.push(kv.to_c_str());
534534
}
535535

@@ -553,7 +553,7 @@ fn with_envp<T>(env: Option<~[(~str, ~str)]>, cb: |*mut c_void| -> T) -> T {
553553
let mut blk = ~[];
554554

555555
for pair in env.iter() {
556-
let kv = format!("{}={}", *pair.ref0(), *pair.ref1());
556+
let kv = format!("{}={}", pair.first(), pair.second());
557557
blk.push_all(kv.as_bytes());
558558
blk.push(0);
559559
}

branches/snap-stage3/src/librustc/middle/trans/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ fn const_expr_unadjusted(cx: @CrateContext, e: &ast::Expr,
599599
const_eval::const_uint(i) => i as uint,
600600
_ => cx.sess.span_bug(count.span, "count must be integral const expression.")
601601
};
602-
let vs = vec::from_elem(n, const_expr(cx, elem, is_local).val0());
602+
let vs = vec::from_elem(n, const_expr(cx, elem, is_local).first());
603603
let v = if vs.iter().any(|vi| val_ty(*vi) != llunitty) {
604604
C_struct(vs, false)
605605
} else {

branches/snap-stage3/src/librustc/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4604,7 +4604,7 @@ pub fn determine_inherited_purity(parent: (ast::Purity, ast::NodeId),
46044604
// purity inferred for it, then check it under its parent's purity.
46054605
// Otherwise, use its own
46064606
match child_sigil {
4607-
ast::BorrowedSigil if child.val0() == ast::ImpureFn => parent,
4607+
ast::BorrowedSigil if child.first() == ast::ImpureFn => parent,
46084608
_ => child
46094609
}
46104610
}

branches/snap-stage3/src/librustdoc/html/render.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,11 +1379,11 @@ fn render_methods(w: &mut Writer, it: &clean::Item) -> fmt::Result {
13791379
match c.impls.find(&it.id) {
13801380
Some(v) => {
13811381
let mut non_trait = v.iter().filter(|p| {
1382-
p.ref0().trait_.is_none()
1382+
p.n0_ref().trait_.is_none()
13831383
});
13841384
let non_trait = non_trait.to_owned_vec();
13851385
let mut traits = v.iter().filter(|p| {
1386-
p.ref0().trait_.is_some()
1386+
p.n0_ref().trait_.is_some()
13871387
});
13881388
let traits = traits.to_owned_vec();
13891389

branches/snap-stage3/src/librustdoc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output {
262262
let mut pm = plugins::PluginManager::new(Path::new(path));
263263
for pass in passes.iter() {
264264
let plugin = match PASSES.iter().position(|&(p, _, _)| p == *pass) {
265-
Some(i) => PASSES[i].val1(),
265+
Some(i) => PASSES[i].n1(),
266266
None => {
267267
error!("unknown pass {}, skipping", *pass);
268268
continue

branches/snap-stage3/src/libstd/comm/shared.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
/// module. You'll also note that the implementation of the shared and stream
1919
/// channels are quite similar, and this is no coincidence!
2020
21-
use cmp;
2221
use int;
2322
use iter::Iterator;
2423
use kinds::Send;
@@ -36,9 +35,6 @@ use mpsc = sync::mpsc_queue;
3635

3736
static DISCONNECTED: int = int::MIN;
3837
static FUDGE: int = 1024;
39-
#[cfg(test)]
40-
static MAX_STEALS: int = 5;
41-
#[cfg(not(test))]
4238
static MAX_STEALS: int = 1 << 20;
4339

4440
pub struct Packet<T> {
@@ -311,11 +307,7 @@ impl<T: Send> Packet<T> {
311307
DISCONNECTED => {
312308
self.cnt.store(DISCONNECTED, atomics::SeqCst);
313309
}
314-
n => {
315-
let m = cmp::min(n, self.steals);
316-
self.steals -= m;
317-
self.cnt.fetch_add(n - m, atomics::SeqCst);
318-
}
310+
n => { self.steals -= n; }
319311
}
320312
assert!(self.steals >= 0);
321313
}

branches/snap-stage3/src/libstd/comm/stream.rs

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
/// High level implementation details can be found in the comment of the parent
1818
/// module.
1919
20-
use cmp;
2120
use comm::Port;
2221
use int;
2322
use iter::Iterator;
@@ -33,9 +32,6 @@ use sync::atomics;
3332
use vec::OwnedVector;
3433

3534
static DISCONNECTED: int = int::MIN;
36-
#[cfg(test)]
37-
static MAX_STEALS: int = 5;
38-
#[cfg(not(test))]
3935
static MAX_STEALS: int = 1 << 20;
4036

4137
pub struct Packet<T> {
@@ -202,28 +198,19 @@ impl<T: Send> Packet<T> {
202198
pub fn try_recv(&mut self) -> Result<T, Failure<T>> {
203199
match self.queue.pop() {
204200
// If we stole some data, record to that effect (this will be
205-
// factored into cnt later on).
206-
//
207-
// Note that we don't allow steals to grow without bound in order to
208-
// prevent eventual overflow of either steals or cnt as an overflow
209-
// would have catastrophic results. Sometimes, steals > cnt, but
210-
// other times cnt > steals, so we don't know the relation between
211-
// steals and cnt. This code path is executed only rarely, so we do
212-
// a pretty slow operation, of swapping 0 into cnt, taking steals
213-
// down as much as possible (without going negative), and then
214-
// adding back in whatever we couldn't factor into steals.
201+
// factored into cnt later on). Note that we don't allow steals to
202+
// grow without bound in order to prevent eventual overflow of
203+
// either steals or cnt as an overflow would have catastrophic
204+
// results. Also note that we don't unconditionally set steals to 0
205+
// because it can be true that steals > cnt.
215206
Some(data) => {
216207
self.steals += 1;
217208
if self.steals > MAX_STEALS {
218209
match self.cnt.swap(0, atomics::SeqCst) {
219210
DISCONNECTED => {
220211
self.cnt.store(DISCONNECTED, atomics::SeqCst);
221212
}
222-
n => {
223-
let m = cmp::min(n, self.steals);
224-
self.steals -= m;
225-
self.cnt.fetch_add(n - m, atomics::SeqCst);
226-
}
213+
n => { self.steals -= n; }
227214
}
228215
assert!(self.steals >= 0);
229216
}

branches/snap-stage3/src/libstd/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2611,7 +2611,7 @@ mod tests {
26112611
assert_eq!(vi.size_hint(), (10, Some(10)));
26122612

26132613
assert_eq!(c.take(5).size_hint(), (5, Some(5)));
2614-
assert_eq!(c.skip(5).size_hint().val1(), None);
2614+
assert_eq!(c.skip(5).size_hint().second(), None);
26152615
assert_eq!(c.take_while(|_| false).size_hint(), (0, None));
26162616
assert_eq!(c.skip_while(|_| false).size_hint(), (0, None));
26172617
assert_eq!(c.enumerate().size_hint(), (uint::MAX, None));

branches/snap-stage3/src/libstd/num/f32.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,7 @@ impl num::FromStrRadix for f32 {
867867
#[cfg(test)]
868868
mod tests {
869869
use f32::*;
870+
use prelude::*;
870871

871872
use num::*;
872873
use num;

branches/snap-stage3/src/libstd/num/f64.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,7 @@ impl num::FromStrRadix for f64 {
869869
#[cfg(test)]
870870
mod tests {
871871
use f64::*;
872+
use prelude::*;
872873

873874
use num::*;
874875
use num;

branches/snap-stage3/src/libstd/prelude.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ pub use io::{Buffer, Writer, Reader, Seek};
6767
pub use str::{Str, StrVector, StrSlice, OwnedStr, IntoMaybeOwned};
6868
pub use to_bytes::IterBytes;
6969
pub use to_str::{ToStr, IntoStr};
70+
pub use tuple::{CloneableTuple, ImmutableTuple};
71+
pub use tuple::{ImmutableTuple1, ImmutableTuple2, ImmutableTuple3, ImmutableTuple4};
72+
pub use tuple::{ImmutableTuple5, ImmutableTuple6, ImmutableTuple7, ImmutableTuple8};
73+
pub use tuple::{ImmutableTuple9, ImmutableTuple10, ImmutableTuple11, ImmutableTuple12};
7074
pub use tuple::{Tuple1, Tuple2, Tuple3, Tuple4};
7175
pub use tuple::{Tuple5, Tuple6, Tuple7, Tuple8};
7276
pub use tuple::{Tuple9, Tuple10, Tuple11, Tuple12};

branches/snap-stage3/src/libstd/str.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -567,14 +567,14 @@ impl<'a> Iterator<&'a str> for StrSplits<'a> {
567567
// Helper functions used for Unicode normalization
568568
fn canonical_sort(comb: &mut [(char, u8)]) {
569569
use iter::range;
570-
use tuple::Tuple2;
570+
use tuple::CloneableTuple;
571571

572572
let len = comb.len();
573573
for i in range(0, len) {
574574
let mut swapped = false;
575575
for j in range(1, len-i) {
576-
let classA = *comb[j-1].ref1();
577-
let classB = *comb[j].ref1();
576+
let classA = comb[j-1].second();
577+
let classB = comb[j].second();
578578
if classA != 0 && classB != 0 && classA > classB {
579579
comb.swap(j-1, j);
580580
swapped = true;

branches/snap-stage3/src/libstd/task.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ use rt::task::Task;
6565
use str::{Str, SendStr, IntoMaybeOwned};
6666

6767
#[cfg(test)] use any::{AnyOwnExt, AnyRefExt};
68+
#[cfg(test)] use ptr;
6869
#[cfg(test)] use result;
6970

7071
/// Indicates the manner in which a task exited.

branches/snap-stage3/src/libstd/to_str.rs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ impl ToStr for () {
4040
fn to_str(&self) -> ~str { ~"()" }
4141
}
4242

43+
impl<A:ToStr> ToStr for (A,) {
44+
#[inline]
45+
fn to_str(&self) -> ~str {
46+
match *self {
47+
(ref a,) => {
48+
format!("({},)", (*a).to_str())
49+
}
50+
}
51+
}
52+
}
53+
4354
impl<A:ToStr+Hash+Eq, B:ToStr> ToStr for HashMap<A, B> {
4455
#[inline]
4556
fn to_str(&self) -> ~str {
@@ -80,6 +91,36 @@ impl<A:ToStr+Hash+Eq> ToStr for HashSet<A> {
8091
}
8192
}
8293
94+
impl<A:ToStr,B:ToStr> ToStr for (A, B) {
95+
#[inline]
96+
fn to_str(&self) -> ~str {
97+
// FIXME(#4653): this causes an llvm assertion
98+
//let &(ref a, ref b) = self;
99+
match *self {
100+
(ref a, ref b) => {
101+
format!("({}, {})", (*a).to_str(), (*b).to_str())
102+
}
103+
}
104+
}
105+
}
106+
107+
impl<A:ToStr,B:ToStr,C:ToStr> ToStr for (A, B, C) {
108+
#[inline]
109+
fn to_str(&self) -> ~str {
110+
// FIXME(#4653): this causes an llvm assertion
111+
//let &(ref a, ref b, ref c) = self;
112+
match *self {
113+
(ref a, ref b, ref c) => {
114+
format!("({}, {}, {})",
115+
(*a).to_str(),
116+
(*b).to_str(),
117+
(*c).to_str()
118+
)
119+
}
120+
}
121+
}
122+
}
123+
83124
impl<'a,A:ToStr> ToStr for &'a [A] {
84125
#[inline]
85126
fn to_str(&self) -> ~str {
@@ -137,6 +178,13 @@ mod tests {
137178
assert_eq!((~"hi").to_str(), ~"hi");
138179
}
139180
181+
#[test]
182+
fn test_tuple_types() {
183+
assert_eq!((1, 2).to_str(), ~"(1, 2)");
184+
assert_eq!((~"a", ~"b", false).to_str(), ~"(a, b, false)");
185+
assert_eq!(((), ((), 100)).to_str(), ~"((), ((), 100))");
186+
}
187+
140188
#[test]
141189
fn test_vectors() {
142190
let x: ~[int] = ~[];

0 commit comments

Comments
 (0)