Skip to content

Commit 05017a4

Browse files
committed
---
yaml --- r: 102134 b: refs/heads/master c: b48bc9e h: refs/heads/master v: v3
1 parent 579e610 commit 05017a4

File tree

155 files changed

+2062
-3288
lines changed

Some content is hidden

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

155 files changed

+2062
-3288
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: 9e8d5aa29e40066b9c247ef252b58c2092ecdfae
2+
refs/heads/master: b48bc9ec935f6c87d16628b026cc4b9c99746b94
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff

trunk/src/compiletest/procsrv.rs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
// except according to those terms.
1010

1111
use std::os;
12-
use std::run;
1312
use std::str;
14-
use std::io::process::ProcessExit;
13+
use std::io::process::{ProcessExit, Process, ProcessConfig, ProcessOutput};
1514

1615
#[cfg(target_os = "win32")]
1716
fn target_env(lib_path: &str, prog: &str) -> ~[(~str,~str)] {
@@ -49,17 +48,19 @@ pub fn run(lib_path: &str,
4948
input: Option<~str>) -> Option<Result> {
5049

5150
let env = env + target_env(lib_path, prog);
52-
let mut opt_process = run::Process::new(prog, args, run::ProcessOptions {
53-
env: Some(env),
54-
.. run::ProcessOptions::new()
51+
let mut opt_process = Process::configure(ProcessConfig {
52+
program: prog,
53+
args: args,
54+
env: Some(env.as_slice()),
55+
.. ProcessConfig::new()
5556
});
5657

5758
match opt_process {
5859
Ok(ref mut process) => {
5960
for input in input.iter() {
60-
process.input().write(input.as_bytes()).unwrap();
61+
process.stdin.get_mut_ref().write(input.as_bytes()).unwrap();
6162
}
62-
let run::ProcessOutput { status, output, error } = process.finish_with_output();
63+
let ProcessOutput { status, output, error } = process.wait_with_output();
6364

6465
Some(Result {
6566
status: status,
@@ -75,18 +76,20 @@ pub fn run_background(lib_path: &str,
7576
prog: &str,
7677
args: &[~str],
7778
env: ~[(~str, ~str)],
78-
input: Option<~str>) -> Option<run::Process> {
79+
input: Option<~str>) -> Option<Process> {
7980

8081
let env = env + target_env(lib_path, prog);
81-
let opt_process = run::Process::new(prog, args, run::ProcessOptions {
82-
env: Some(env),
83-
.. run::ProcessOptions::new()
82+
let opt_process = Process::configure(ProcessConfig {
83+
program: prog,
84+
args: args,
85+
env: Some(env.as_slice()),
86+
.. ProcessConfig::new()
8487
});
8588

8689
match opt_process {
8790
Ok(mut process) => {
8891
for input in input.iter() {
89-
process.input().write(input.as_bytes()).unwrap();
92+
process.stdin.get_mut_ref().write(input.as_bytes()).unwrap();
9093
}
9194

9295
Some(process)

trunk/src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
360360
stdout: out,
361361
stderr: err,
362362
cmdline: cmdline};
363-
process.force_destroy().unwrap();
363+
process.signal_kill().unwrap();
364364
}
365365

366366
_=> {

trunk/src/doc/complement-cheatsheet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ Description C signature Equivalent
211211
---------------------- ---------------------------------------------- ------------------------------------------
212212
no parameters `void foo(void);` `fn foo();`
213213
return value `int foo(void);` `fn foo() -> c_int;`
214-
function parameters `void foo(int x, int y);` `fn foo(x: int, y: int);`
214+
function parameters `void foo(int x, int y);` `fn foo(x: c_int, y: c_int);`
215215
in-out pointers `void foo(const int* in_ptr, int* out_ptr);` `fn foo(in_ptr: *c_int, out_ptr: *mut c_int);`
216216
217217
Note: The Rust signatures should be wrapped in an `extern "ABI" { ... }` block.

trunk/src/doc/guide-container.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ order.
3838
Each `HashMap` instance has a random 128-bit key to use with a keyed hash,
3939
making the order of a set of keys in a given hash table randomized. Rust
4040
provides a [SipHash](https://131002.net/siphash/) implementation for any type
41-
implementing the `IterBytes` trait.
41+
implementing the `Hash` trait.
4242

4343
## Double-ended queues
4444

@@ -186,12 +186,12 @@ let mut calls = 0;
186186
let it = xs.iter().scan((), |_, x| {
187187
calls += 1;
188188
if *x < 3 { Some(x) } else { None }});
189-
189+
190190
// the iterator will only yield 1 and 2 before returning None
191191
// If we were to call it 5 times, calls would end up as 5, despite
192192
// only 2 values being yielded (and therefore 3 unique calls being
193193
// made). The fuse() adaptor can fix this.
194-
194+
195195
let mut it = it.fuse();
196196
it.next();
197197
it.next();

trunk/src/doc/po/ja/tutorial.md.po

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4421,15 +4421,15 @@ msgstr ""
44214421
#, fuzzy
44224422
#| msgid ""
44234423
#| "The full list of derivable traits is `Eq`, `TotalEq`, `Ord`, `TotalOrd`, "
4424-
#| "`Encodable` `Decodable`, `Clone`, `DeepClone`, `IterBytes`, `Rand`, "
4424+
#| "`Encodable` `Decodable`, `Clone`, `DeepClone`, `Hash`, `Rand`, "
44254425
#| "`Zero`, and `ToStr`."
44264426
msgid ""
44274427
"The full list of derivable traits is `Eq`, `TotalEq`, `Ord`, `TotalOrd`, "
4428-
"`Encodable` `Decodable`, `Clone`, `DeepClone`, `IterBytes`, `Rand`, "
4428+
"`Encodable` `Decodable`, `Clone`, `DeepClone`, `Hash`, `Rand`, "
44294429
"`Default`, `Zero`, and `ToStr`."
44304430
msgstr ""
44314431
"実装を自動的に導出可能なトレイトは、 `Eq`, `TotalEq`, `Ord`, `TotalOrd`, "
4432-
"`Encodable` `Decodable`, `Clone`, `DeepClone`, `IterBytes`, `Rand`, `Zero`, "
4432+
"`Encodable` `Decodable`, `Clone`, `DeepClone`, `Hash`, `Rand`, `Zero`, "
44334433
"および `ToStr` です。."
44344434

44354435
#. type: Plain text

trunk/src/doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2035,7 +2035,7 @@ Supported traits for `deriving` are:
20352035
* Comparison traits: `Eq`, `TotalEq`, `Ord`, `TotalOrd`.
20362036
* Serialization: `Encodable`, `Decodable`. These require `serialize`.
20372037
* `Clone` and `DeepClone`, to perform (deep) copies.
2038-
* `IterBytes`, to iterate over the bytes in a data type.
2038+
* `Hash`, to iterate over the bytes in a data type.
20392039
* `Rand`, to create a random instance of a data type.
20402040
* `Default`, to create an empty instance of a data type.
20412041
* `Zero`, to create an zero instance of a numeric data type.

trunk/src/doc/tutorial.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,7 @@ type was invalid because the size was infinite!
10261026

10271027
An *owned box* (`~`) uses a dynamic memory allocation to provide the invariant
10281028
of always being the size of a pointer, regardless of the contained type. This
1029-
can be leverage to create a valid `List` definition:
1029+
can be leveraged to create a valid `List` definition:
10301030

10311031
~~~
10321032
enum List {
@@ -2519,13 +2519,13 @@ of type `ABC` can be randomly generated and converted to a string:
25192519
#[deriving(Eq)]
25202520
struct Circle { radius: f64 }
25212521
2522-
#[deriving(Rand, ToStr)]
2522+
#[deriving(Rand, Show)]
25232523
enum ABC { A, B, C }
25242524
~~~
25252525

25262526
The full list of derivable traits is `Eq`, `TotalEq`, `Ord`,
25272527
`TotalOrd`, `Encodable` `Decodable`, `Clone`, `DeepClone`,
2528-
`IterBytes`, `Rand`, `Default`, `Zero`, `FromPrimitive` and `Show`.
2528+
`Hash`, `Rand`, `Default`, `Zero`, `FromPrimitive` and `Show`.
25292529

25302530
# Crates and the module system
25312531

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ syn keyword rustTrait GenericPath Path PosixPath WindowsPath
9393
syn keyword rustTrait RawPtr
9494
syn keyword rustTrait Buffer Writer Reader Seek
9595
syn keyword rustTrait Str StrVector StrSlice OwnedStr IntoMaybeOwned
96-
syn keyword rustTrait IterBytes
9796
syn keyword rustTrait ToStr IntoStr
9897
syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4
9998
syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8

trunk/src/libcollections/btree.rs

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
///a length (the height of the tree), and lower and upper bounds on the
1919
///number of elements that a given node can contain.
2020
21-
use std::vec::OwnedVector;
21+
use std::fmt;
22+
use std::fmt::Show;
2223

2324
#[allow(missing_doc)]
2425
pub struct BTree<K, V> {
@@ -106,11 +107,10 @@ impl<K: TotalOrd, V: TotalEq> TotalOrd for BTree<K, V> {
106107
}
107108
}
108109

109-
impl<K: ToStr + TotalOrd, V: ToStr> ToStr for BTree<K, V> {
110+
impl<K: fmt::Show + TotalOrd, V: fmt::Show> fmt::Show for BTree<K, V> {
110111
///Returns a string representation of the BTree
111-
fn to_str(&self) -> ~str {
112-
let ret = self.root.to_str();
113-
ret
112+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
113+
self.root.fmt(f)
114114
}
115115
}
116116

@@ -235,15 +235,15 @@ impl<K: TotalOrd, V: TotalEq> TotalOrd for Node<K, V> {
235235
}
236236
}
237237

238-
impl<K: ToStr + TotalOrd, V: ToStr> ToStr for Node<K, V> {
238+
impl<K: fmt::Show + TotalOrd, V: fmt::Show> fmt::Show for Node<K, V> {
239239
///Returns a string representation of a Node.
240240
///Will iterate over the Node and show "Key: x, value: y, child: () // "
241241
///for all elements in the Node. "Child" only exists if the Node contains
242242
///a branch.
243-
fn to_str(&self) -> ~str {
243+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
244244
match *self {
245-
LeafNode(ref leaf) => leaf.to_str(),
246-
BranchNode(ref branch) => branch.to_str()
245+
LeafNode(ref leaf) => leaf.fmt(f),
246+
BranchNode(ref branch) => branch.fmt(f),
247247
}
248248
}
249249
}
@@ -401,10 +401,14 @@ impl<K: TotalOrd, V: TotalEq> TotalOrd for Leaf<K, V> {
401401
}
402402

403403

404-
impl<K: ToStr + TotalOrd, V: ToStr> ToStr for Leaf<K, V> {
404+
impl<K: fmt::Show + TotalOrd, V: fmt::Show> fmt::Show for Leaf<K, V> {
405405
///Returns a string representation of a Leaf.
406-
fn to_str(&self) -> ~str {
407-
self.elts.iter().map(|s| s.to_str()).to_owned_vec().connect(" // ")
406+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
407+
for (i, s) in self.elts.iter().enumerate() {
408+
if i != 0 { try!(write!(f.buf, " // ")) }
409+
try!(write!(f.buf, "{}", *s))
410+
}
411+
Ok(())
408412
}
409413
}
410414

@@ -618,13 +622,14 @@ impl<K: TotalOrd, V: TotalEq> TotalOrd for Branch<K, V> {
618622
}
619623
}
620624

621-
impl<K: ToStr + TotalOrd, V: ToStr> ToStr for Branch<K, V> {
625+
impl<K: fmt::Show + TotalOrd, V: fmt::Show> fmt::Show for Branch<K, V> {
622626
///Returns a string representation of a Branch.
623-
fn to_str(&self) -> ~str {
624-
let mut ret = self.elts.iter().map(|s| s.to_str()).to_owned_vec().connect(" // ");
625-
ret.push_str(" // ");
626-
ret.push_str("rightmost child: ("+ self.rightmost_child.to_str() +") ");
627-
ret
627+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
628+
for (i, s) in self.elts.iter().enumerate() {
629+
if i != 0 { try!(write!(f.buf, " // ")) }
630+
try!(write!(f.buf, "{}", *s))
631+
}
632+
write!(f.buf, " // rightmost child: ({}) ", *self.rightmost_child)
628633
}
629634
}
630635

@@ -672,11 +677,10 @@ impl<K: TotalOrd, V: TotalEq> TotalOrd for LeafElt<K, V> {
672677
}
673678
}
674679

675-
impl<K: ToStr + TotalOrd, V: ToStr> ToStr for LeafElt<K, V> {
680+
impl<K: fmt::Show + TotalOrd, V: fmt::Show> fmt::Show for LeafElt<K, V> {
676681
///Returns a string representation of a LeafElt.
677-
fn to_str(&self) -> ~str {
678-
format!("Key: {}, value: {};",
679-
self.key.to_str(), self.value.to_str())
682+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
683+
write!(f.buf, "Key: {}, value: {};", self.key, self.value)
680684
}
681685
}
682686

@@ -715,12 +719,12 @@ impl<K: TotalOrd, V: TotalEq> TotalOrd for BranchElt<K, V> {
715719
}
716720
}
717721

718-
impl<K: ToStr + TotalOrd, V: ToStr> ToStr for BranchElt<K, V> {
719-
///Returns string containing key, value, and child (which should recur to a leaf)
720-
///Consider changing in future to be more readable.
721-
fn to_str(&self) -> ~str {
722-
format!("Key: {}, value: {}, (child: {})",
723-
self.key.to_str(), self.value.to_str(), self.left.to_str())
722+
impl<K: fmt::Show + TotalOrd, V: fmt::Show> fmt::Show for BranchElt<K, V> {
723+
/// Returns string containing key, value, and child (which should recur to a
724+
/// leaf) Consider changing in future to be more readable.
725+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
726+
write!(f.buf, "Key: {}, value: {}, (child: {})",
727+
self.key, self.value, *self.left)
724728
}
725729
}
726730

trunk/src/libcollections/enum_set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
1616
use std::num::Bitwise;
1717

18-
#[deriving(Clone, Eq, IterBytes, ToStr, Encodable, Decodable)]
18+
#[deriving(Clone, Eq, Hash, Show, Encodable, Decodable)]
1919
/// A specialized Set implementation to use enum types.
2020
pub struct EnumSet<E> {
2121
// We must maintain the invariant that no bits are set

0 commit comments

Comments
 (0)