Skip to content

Commit a06998a

Browse files
committed
---
yaml --- r: 183519 b: refs/heads/beta c: 5e3ae10 h: refs/heads/master i: 183517: dc4e21f 183515: 013f853 183511: b9d8d95 183503: 40ed6ff 183487: acf4a4b v: v3
1 parent 7d8b2d7 commit a06998a

File tree

114 files changed

+3621
-6494
lines changed

Some content is hidden

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

114 files changed

+3621
-6494
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 63091efa3bdcb18a6fac8af48acfa5634087624b
34+
refs/heads/beta: 5e3ae102dbeeb646e8c7d2d423cea263337a76af
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: eb836bf767aa1d8d4cba488a9091cde3c0ab4b2f

branches/beta/configure

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,8 +1379,7 @@ do
13791379
done
13801380

13811381
# Munge any paths that appear in config.mk back to posix-y
1382-
cp config.tmp config.tmp.bak
1383-
sed -e 's@ \([a-zA-Z]\):[/\\]@ /\1/@g;' <config.tmp.bak >config.tmp
1382+
sed -i.bak -e 's@ \([a-zA-Z]\):[/\\]@ /\1/@g;' config.tmp
13841383
rm -f config.tmp.bak
13851384

13861385
msg

branches/beta/mk/main.mk

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,13 @@ SPACE :=
6161
SPACE +=
6262
ifneq ($(CFG_GIT),)
6363
ifneq ($(wildcard $(subst $(SPACE),\$(SPACE),$(CFG_GIT_DIR))),)
64-
CFG_VER_DATE = $(shell git --git-dir='$(CFG_GIT_DIR)' log -1 --date=short --pretty=format:'%cd')
64+
CFG_VER_DATE = $(shell git --git-dir='$(CFG_GIT_DIR)' log -1 --pretty=format:'%ci')
6565
CFG_VER_HASH = $(shell git --git-dir='$(CFG_GIT_DIR)' rev-parse HEAD)
6666
CFG_SHORT_VER_HASH = $(shell git --git-dir='$(CFG_GIT_DIR)' rev-parse --short=9 HEAD)
6767
CFG_VERSION += ($(CFG_SHORT_VER_HASH) $(CFG_VER_DATE))
6868
endif
6969
endif
7070

71-
CFG_BUILD_DATE = $(shell date +%F)
72-
CFG_VERSION += (built $(CFG_BUILD_DATE))
73-
7471
# Windows exe's need numeric versions - don't use anything but
7572
# numbers and dots here
7673
CFG_VERSION_WIN = $(CFG_RELEASE_NUM)
@@ -320,7 +317,6 @@ endif
320317
ifdef CFG_VER_HASH
321318
export CFG_VER_HASH
322319
endif
323-
export CFG_BUILD_DATE
324320
export CFG_VERSION
325321
export CFG_VERSION_WIN
326322
export CFG_RELEASE

branches/beta/src/doc/reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3005,7 +3005,7 @@ Some examples of call expressions:
30053005
# fn add(x: i32, y: i32) -> i32 { 0 }
30063006
30073007
let x: i32 = add(1i32, 2i32);
3008-
let pi: Result<f32, _> = "3.14".parse();
3008+
let pi: Option<f32> = "3.14".parse().ok();
30093009
```
30103010

30113011
### Lambda expressions
@@ -3148,7 +3148,7 @@ An example of a for loop over a series of integers:
31483148

31493149
```
31503150
# fn bar(b:usize) { }
3151-
for i in 0us..256 {
3151+
for i in range(0us, 256) {
31523152
bar(i);
31533153
}
31543154
```
@@ -3532,7 +3532,7 @@ An example of each kind:
35323532
```{rust}
35333533
let vec: Vec<i32> = vec![1, 2, 3];
35343534
let arr: [i32; 3] = [1, 2, 3];
3535-
let s: &[i32] = &vec[];
3535+
let s: &[i32] = &vec;
35363536
```
35373537

35383538
As you can see, the `vec!` macro allows you to create a `Vec<T>` easily. The

branches/beta/src/doc/trpl/concurrency.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ use std::sync::mpsc;
354354
fn main() {
355355
let (tx, rx) = mpsc::channel();
356356
357-
for _ in 0..10 {
357+
for _ in range(0, 10) {
358358
let tx = tx.clone();
359359
360360
Thread::spawn(move || {

branches/beta/src/doc/trpl/documentation.md

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% Documentation
1+
% Rust Documentation
22

33
`rustdoc` is the built-in tool for generating documentation. It integrates
44
with the compiler to provide accurate hyperlinking between usage of types and
@@ -294,26 +294,3 @@ Documentation` on the first line).
294294
Like with a Rust crate, the `--test` argument will run the code
295295
examples to check they compile, and obeys any `--test-args` flags. The
296296
tests are named after the last `#` heading.
297-
298-
# Re-exports
299-
300-
Rustdoc will show the documentation for a publc re-export in both places:
301-
302-
```{rust,ignore}
303-
extern crate foo;
304-
305-
pub use foo::bar;
306-
```
307-
308-
This will create documentation for `bar` both inside the documentation for
309-
the crate `foo`, as well as the documentation for your crate. It will use
310-
the same documentation in both places.
311-
312-
This behavior can be supressed with `no_inline`:
313-
314-
```{rust,ignore}
315-
extern crate foo;
316-
317-
#[doc(no_inline)]
318-
pub use foo::bar;
319-
```

branches/beta/src/doc/trpl/guessing-game.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ a function for that:
400400
let input = old_io::stdin().read_line()
401401
.ok()
402402
.expect("Failed to read line");
403-
let input_num: Result<u32, _> = input.parse();
403+
let input_num: Option<u32> = input.parse().ok();
404404
```
405405
406406
The `parse` function takes in a `&str` value and converts it into something.
@@ -422,8 +422,8 @@ In this case, we say `x` is a `u32` explicitly, so Rust is able to properly
422422
tell `random()` what to generate. In a similar fashion, both of these work:
423423
424424
```{rust,ignore}
425-
let input_num = "5".parse::<u32>(); // input_num: Option<u32>
426-
let input_num: Result<u32, _> = "5".parse(); // input_num: Result<u32, <u32 as FromStr>::Err>
425+
let input_num = "5".parse::<u32>().ok(); // input_num: Option<u32>
426+
let input_num: Option<u32> = "5".parse().ok(); // input_num: Option<u32>
427427
```
428428
429429
Here we're converting the `Result` returned by `parse` to an `Option` by using
@@ -447,9 +447,9 @@ fn main() {
447447
let input = old_io::stdin().read_line()
448448
.ok()
449449
.expect("Failed to read line");
450-
let input_num: Result<u32, _> = input.parse();
450+
let input_num: Option<u32> = input.parse().ok();
451451
452-
println!("You guessed: {:?}", input_num);
452+
println!("You guessed: {}", input_num);
453453
454454
match cmp(input_num, secret_number) {
455455
Ordering::Less => println!("Too small!"),
@@ -497,11 +497,11 @@ fn main() {
497497
let input = old_io::stdin().read_line()
498498
.ok()
499499
.expect("Failed to read line");
500-
let input_num: Result<u32, _> = input.parse();
500+
let input_num: Option<u32> = input.parse().ok();
501501

502502
let num = match input_num {
503-
Ok(num) => num,
504-
Err(_) => {
503+
Some(num) => num,
504+
None => {
505505
println!("Please input a number!");
506506
return;
507507
}
@@ -564,11 +564,11 @@ fn main() {
564564
let input = old_io::stdin().read_line()
565565
.ok()
566566
.expect("Failed to read line");
567-
let input_num: Result<u32, _> = input.trim().parse();
567+
let input_num: Option<u32> = input.trim().parse().ok();
568568

569569
let num = match input_num {
570-
Ok(num) => num,
571-
Err(_) => {
570+
Some(num) => num,
571+
None => {
572572
println!("Please input a number!");
573573
return;
574574
}
@@ -640,11 +640,11 @@ fn main() {
640640
let input = old_io::stdin().read_line()
641641
.ok()
642642
.expect("Failed to read line");
643-
let input_num: Result<u32, _> = input.trim().parse();
643+
let input_num: Option<u32> = input.trim().parse().ok();
644644
645645
let num = match input_num {
646-
Ok(num) => num,
647-
Err(_) => {
646+
Some(num) => num,
647+
None => {
648648
println!("Please input a number!");
649649
return;
650650
}
@@ -716,11 +716,11 @@ fn main() {
716716
let input = old_io::stdin().read_line()
717717
.ok()
718718
.expect("Failed to read line");
719-
let input_num: Result<u32, _> = input.trim().parse();
719+
let input_num: Option<u32> = input.trim().parse().ok();
720720

721721
let num = match input_num {
722-
Ok(num) => num,
723-
Err(_) => {
722+
Some(num) => num,
723+
None => {
724724
println!("Please input a number!");
725725
return;
726726
}
@@ -772,11 +772,11 @@ fn main() {
772772
let input = old_io::stdin().read_line()
773773
.ok()
774774
.expect("Failed to read line");
775-
let input_num: Result<u32, _> = input.trim().parse();
775+
let input_num: Option<u32> = input.trim().parse().ok();
776776

777777
let num = match input_num {
778-
Ok(num) => num,
779-
Err(_) => {
778+
Some(num) => num,
779+
None => {
780780
println!("Please input a number!");
781781
continue;
782782
}
@@ -849,11 +849,11 @@ fn main() {
849849
let input = old_io::stdin().read_line()
850850
.ok()
851851
.expect("Failed to read line");
852-
let input_num: Result<u32, _> = input.trim().parse();
852+
let input_num: Option<u32> = input.trim().parse().ok();
853853

854854
let num = match input_num {
855-
Ok(num) => num,
856-
Err(_) => {
855+
Some(num) => num,
856+
None => {
857857
println!("Please input a number!");
858858
continue;
859859
}

branches/beta/src/doc/trpl/iterators.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Let's talk about loops.
55
Remember Rust's `for` loop? Here's an example:
66

77
```{rust}
8-
for x in 0..10 {
8+
for x in range(0, 10) {
99
println!("{}", x);
1010
}
1111
```
@@ -17,7 +17,7 @@ call the `.next()` method on repeatedly, and it gives us a sequence of things.
1717
Like this:
1818

1919
```{rust}
20-
let mut range = 0..10;
20+
let mut range = range(0, 10);
2121
2222
loop {
2323
match range.next() {
@@ -52,7 +52,7 @@ a vector, you may be tempted to write this:
5252
```{rust}
5353
let nums = vec![1, 2, 3];
5454
55-
for i in 0..nums.len() {
55+
for i in range(0, nums.len()) {
5656
println!("{}", nums[i]);
5757
}
5858
```
@@ -118,7 +118,7 @@ The most common consumer is `collect()`. This code doesn't quite compile,
118118
but it shows the intention:
119119

120120
```{rust,ignore}
121-
let one_to_one_hundred = (1..101i32).collect();
121+
let one_to_one_hundred = range(1, 101).collect();
122122
```
123123

124124
As you can see, we call `collect()` on our iterator. `collect()` takes
@@ -128,7 +128,7 @@ type of things you want to collect, and so you need to let it know.
128128
Here's the version that does compile:
129129

130130
```{rust}
131-
let one_to_one_hundred = (1..101i32).collect::<Vec<i32>>();
131+
let one_to_one_hundred = range(1, 101).collect::<Vec<i32>>();
132132
```
133133

134134
If you remember, the `::<>` syntax allows us to give a type hint,
@@ -138,7 +138,7 @@ and so we tell it that we want a vector of integers.
138138
is one:
139139

140140
```{rust}
141-
let greater_than_forty_two = (0..100i32)
141+
let greater_than_forty_two = range(0, 100)
142142
.find(|x| *x > 42);
143143
144144
match greater_than_forty_two {
@@ -155,7 +155,7 @@ element, `find` returns an `Option` rather than the element itself.
155155
Another important consumer is `fold`. Here's what it looks like:
156156

157157
```{rust}
158-
let sum = (1..4)
158+
let sum = range(1, 4)
159159
.fold(0, |sum, x| sum + x);
160160
```
161161

@@ -179,7 +179,7 @@ in this iterator:
179179
We called `fold()` with these arguments:
180180

181181
```{rust}
182-
# (1..4)
182+
# range(1, 4)
183183
.fold(0, |sum, x| sum + x);
184184
```
185185

@@ -210,20 +210,20 @@ This code, for example, does not actually generate the numbers
210210
`1-100`, and just creates a value that represents the sequence:
211211

212212
```{rust}
213-
let nums = 1..100;
213+
let nums = range(1, 100);
214214
```
215215

216216
Since we didn't do anything with the range, it didn't generate the sequence.
217217
Let's add the consumer:
218218

219219
```{rust}
220-
let nums = (1..100).collect::<Vec<i32>>();
220+
let nums = range(1, 100).collect::<Vec<i32>>();
221221
```
222222

223-
Now, `collect()` will require that the range gives it some numbers, and so
223+
Now, `collect()` will require that `range()` give it some numbers, and so
224224
it will do the work of generating the sequence.
225225

226-
A range is one of two basic iterators that you'll see. The other is `iter()`,
226+
`range` is one of two basic iterators that you'll see. The other is `iter()`,
227227
which you've used before. `iter()` can turn a vector into a simple iterator
228228
that gives you each element in turn:
229229

@@ -256,7 +256,7 @@ we need to talk about with regards to iterators. Let's get to it!
256256
a new iterator. The simplest one is called `map`:
257257

258258
```{rust,ignore}
259-
(1..100i32).map(|x| x + 1);
259+
range(1, 100).map(|x| x + 1);
260260
```
261261

262262
`map` is called upon another iterator, and produces a new iterator where each
@@ -267,15 +267,15 @@ compile the example, you'll get a warning:
267267
```{notrust,ignore}
268268
warning: unused result which must be used: iterator adaptors are lazy and
269269
do nothing unless consumed, #[warn(unused_must_use)] on by default
270-
(1..100).map(|x| x + 1);
270+
range(1, 100).map(|x| x + 1);
271271
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
272272
```
273273

274274
Laziness strikes again! That closure will never execute. This example
275275
doesn't print any numbers:
276276

277277
```{rust,ignore}
278-
(1..100).map(|x| println!("{}", x));
278+
range(1, 100).map(|x| println!("{}", x));
279279
```
280280

281281
If you are trying to execute a closure on an iterator for its side effects,
@@ -307,7 +307,7 @@ returns `true` or `false`. The new iterator `filter()` produces
307307
only the elements that that closure returns `true` for:
308308

309309
```{rust}
310-
for i in (1..100i32).filter(|&x| x % 2 == 0) {
310+
for i in range(1, 100).filter(|&x| x % 2 == 0) {
311311
println!("{}", i);
312312
}
313313
```
@@ -322,7 +322,7 @@ You can chain all three things together: start with an iterator, adapt it
322322
a few times, and then consume the result. Check it out:
323323

324324
```{rust}
325-
(1..1000i32)
325+
range(1, 1000)
326326
.filter(|&x| x % 2 == 0)
327327
.filter(|&x| x % 3 == 0)
328328
.take(5)

branches/beta/src/doc/trpl/ownership.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ struct Wheel {
418418
fn main() {
419419
let car = Car { name: "DeLorean".to_string() };
420420
421-
for _ in 0..4 {
421+
for _ in range(0, 4) {
422422
Wheel { size: 360, owner: car };
423423
}
424424
}
@@ -456,7 +456,7 @@ fn main() {
456456

457457
let car_owner = Rc::new(car);
458458

459-
for _ in 0..4 {
459+
for _ in range(0, 4) {
460460
Wheel { size: 360, owner: car_owner.clone() };
461461
}
462462
}

0 commit comments

Comments
 (0)