Skip to content

Commit a97c550

Browse files
committed
---
yaml --- r: 101900 b: refs/heads/master c: 13dc521 h: refs/heads/master v: v3
1 parent ca92757 commit a97c550

File tree

22 files changed

+223
-329
lines changed

22 files changed

+223
-329
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 58a2b7da077b0372e4a06cdf55d1fe08800fbfec
2+
refs/heads/master: 13dc521861f6c3be909ba9317fde50f946e9f85d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff

trunk/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_MAKEFILE_DEPS),)
48+
ifneq ($(NO_MKFILE_DEPS),)
4949
MKFILE_DEPS :=
5050
else
5151
MKFILE_DEPS := config.stamp $(call rwildcard,$(CFG_SRC_DIR)mk/,*)

trunk/mk/tests.mk

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,6 @@ 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-
187177
check-lite: cleantestlibs cleantmptestlogs \
188178
$(foreach crate,$(TARGET_CRATES),check-stage2-$(crate)) \
189179
check-stage2-rpass \

trunk/src/etc/vim/syntax/rust.vim

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,9 @@ 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
9998
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
10099
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8
101100
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
105101
syn keyword rustTrait ImmutableEqVector ImmutableTotalOrdVector ImmutableCloneableVector
106102
syn keyword rustTrait OwnedVector OwnedCloneableVector OwnedEqVector MutableVector
107103
syn keyword rustTrait Vector VectorVector CloneableVector ImmutableVector

trunk/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().n0();
504-
outcome = new_outcome.n1();
503+
new_branch = new_outcome.clone().val0();
504+
outcome = new_outcome.val1();
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().n0();
511-
outcome = new_outcome.n1();
510+
new_branch = new_outcome.clone().val0();
511+
outcome = new_outcome.val1();
512512
}
513513
//Check to see whether a branch or a leaf was returned from the
514514
//tree traversal.

trunk/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.first(), pair.second());
532+
let kv = format!("{}={}", *pair.ref0(), *pair.ref1());
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.first(), pair.second());
556+
let kv = format!("{}={}", *pair.ref0(), *pair.ref1());
557557
blk.push_all(kv.as_bytes());
558558
blk.push(0);
559559
}

trunk/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).first());
602+
let vs = vec::from_elem(n, const_expr(cx, elem, is_local).val0());
603603
let v = if vs.iter().any(|vi| val_ty(*vi) != llunitty) {
604604
C_struct(vs, false)
605605
} else {

trunk/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.first() == ast::ImpureFn => parent,
4607+
ast::BorrowedSigil if child.val0() == ast::ImpureFn => parent,
46084608
_ => child
46094609
}
46104610
}

trunk/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.n0_ref().trait_.is_none()
1382+
p.ref0().trait_.is_none()
13831383
});
13841384
let non_trait = non_trait.to_owned_vec();
13851385
let mut traits = v.iter().filter(|p| {
1386-
p.n0_ref().trait_.is_some()
1386+
p.ref0().trait_.is_some()
13871387
});
13881388
let traits = traits.to_owned_vec();
13891389

trunk/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].n1(),
265+
Some(i) => PASSES[i].val1(),
266266
None => {
267267
error!("unknown pass {}, skipping", *pass);
268268
continue

trunk/src/libstd/comm/shared.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
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;
2122
use int;
2223
use iter::Iterator;
2324
use kinds::Send;
@@ -35,6 +36,9 @@ use mpsc = sync::mpsc_queue;
3536

3637
static DISCONNECTED: int = int::MIN;
3738
static FUDGE: int = 1024;
39+
#[cfg(test)]
40+
static MAX_STEALS: int = 5;
41+
#[cfg(not(test))]
3842
static MAX_STEALS: int = 1 << 20;
3943

4044
pub struct Packet<T> {
@@ -307,7 +311,11 @@ impl<T: Send> Packet<T> {
307311
DISCONNECTED => {
308312
self.cnt.store(DISCONNECTED, atomics::SeqCst);
309313
}
310-
n => { self.steals -= n; }
314+
n => {
315+
let m = cmp::min(n, self.steals);
316+
self.steals -= m;
317+
self.cnt.fetch_add(n - m, atomics::SeqCst);
318+
}
311319
}
312320
assert!(self.steals >= 0);
313321
}

trunk/src/libstd/comm/stream.rs

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

3435
static DISCONNECTED: int = int::MIN;
36+
#[cfg(test)]
37+
static MAX_STEALS: int = 5;
38+
#[cfg(not(test))]
3539
static MAX_STEALS: int = 1 << 20;
3640

3741
pub struct Packet<T> {
@@ -198,19 +202,28 @@ impl<T: Send> Packet<T> {
198202
pub fn try_recv(&mut self) -> Result<T, Failure<T>> {
199203
match self.queue.pop() {
200204
// If we stole some data, record to that effect (this will be
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.
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.
206215
Some(data) => {
207216
self.steals += 1;
208217
if self.steals > MAX_STEALS {
209218
match self.cnt.swap(0, atomics::SeqCst) {
210219
DISCONNECTED => {
211220
self.cnt.store(DISCONNECTED, atomics::SeqCst);
212221
}
213-
n => { self.steals -= n; }
222+
n => {
223+
let m = cmp::min(n, self.steals);
224+
self.steals -= m;
225+
self.cnt.fetch_add(n - m, atomics::SeqCst);
226+
}
214227
}
215228
assert!(self.steals >= 0);
216229
}

trunk/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().second(), None);
2614+
assert_eq!(c.skip(5).size_hint().val1(), 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));

trunk/src/libstd/num/f32.rs

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

872871
use num::*;
873872
use num;

trunk/src/libstd/num/f64.rs

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

874873
use num::*;
875874
use num;

trunk/src/libstd/prelude.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ 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};
7470
pub use tuple::{Tuple1, Tuple2, Tuple3, Tuple4};
7571
pub use tuple::{Tuple5, Tuple6, Tuple7, Tuple8};
7672
pub use tuple::{Tuple9, Tuple10, Tuple11, Tuple12};

trunk/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::CloneableTuple;
570+
use tuple::Tuple2;
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].second();
577-
let classB = comb[j].second();
576+
let classA = *comb[j-1].ref1();
577+
let classB = *comb[j].ref1();
578578
if classA != 0 && classB != 0 && classA > classB {
579579
comb.swap(j-1, j);
580580
swapped = true;

trunk/src/libstd/task.rs

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

6767
#[cfg(test)] use any::{AnyOwnExt, AnyRefExt};
68-
#[cfg(test)] use ptr;
6968
#[cfg(test)] use result;
7069

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

trunk/src/libstd/to_str.rs

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,6 @@ 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-
5443
impl<A:ToStr+Hash+Eq, B:ToStr> ToStr for HashMap<A, B> {
5544
#[inline]
5645
fn to_str(&self) -> ~str {
@@ -91,36 +80,6 @@ impl<A:ToStr+Hash+Eq> ToStr for HashSet<A> {
9180
}
9281
}
9382
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-
12483
impl<'a,A:ToStr> ToStr for &'a [A] {
12584
#[inline]
12685
fn to_str(&self) -> ~str {
@@ -178,13 +137,6 @@ mod tests {
178137
assert_eq!((~"hi").to_str(), ~"hi");
179138
}
180139
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-
188140
#[test]
189141
fn test_vectors() {
190142
let x: ~[int] = ~[];

0 commit comments

Comments
 (0)