Skip to content

Commit a324917

Browse files
committed
---
yaml --- r: 101901 b: refs/heads/master c: 3a66548 h: refs/heads/master i: 101899: ca92757 v: v3
1 parent a97c550 commit a324917

File tree

17 files changed

+320
-203
lines changed

17 files changed

+320
-203
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: 13dc521861f6c3be909ba9317fde50f946e9f85d
2+
refs/heads/master: 3a66548979e38a4687870816c0d79e7bd1bb67db
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff

trunk/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ config.mk
6060
/rt/
6161
/rustllvm/
6262
/test/
63-
/build/
63+
/build
6464
/inst/
6565
/mingw-build/
6666
src/.DS_Store

trunk/src/doc/index.md

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

2525
# Libraries
2626

27-
* [The standard library, `std`](std/index.html)
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)
2837

2938
* [The `arena` allocation library](arena/index.html)
39+
* [The `num` arbitrary precision numerics library](num/index.html)
3040
* [The `collections` library](collections/index.html)
31-
* [The `extra` library of extra stuff](extra/index.html)
3241
* [The `flate` compression library](flate/index.html)
3342
* [The `fourcc` four-character code library](fourcc/index.html)
3443
* [The `getopts` argument parsing library](getopts/index.html)
3544
* [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)
4145
* [The `semver` version collation library](semver/index.html)
4246
* [The `serialize` value encoding/decoding library](serialize/index.html)
4347
* [The `sync` library for concurrency-enabled mechanisms and primitives](sync/index.html)
44-
* [The `syntax` library, the Rust parser](syntax/index.html)
4548
* [The `term` terminal-handling library](term/index.html)
4649
* [The `uuid` 128-bit universally unique identifier library](uuid/index.html)
4750

trunk/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

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().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.

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.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
}

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).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 {

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.val0() == ast::ImpureFn => parent,
4607+
ast::BorrowedSigil if child.first() == 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.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

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

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().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));

trunk/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};

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::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;

trunk/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)