Skip to content

Commit 835a187

Browse files
committed
---
yaml --- r: 183548 b: refs/heads/beta c: 33371bf h: refs/heads/master v: v3
1 parent c2ad2d0 commit 835a187

File tree

126 files changed

+6615
-3457
lines changed

Some content is hidden

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

126 files changed

+6615
-3457
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: d414a3919740726e18897b6e39f66e8a25f00a5c
34+
refs/heads/beta: 33371bfc41349c4e127e10b71ef2891513079b9c
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: eb836bf767aa1d8d4cba488a9091cde3c0ab4b2f

branches/beta/configure

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

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

13851386
msg

branches/beta/mk/main.mk

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,16 @@ 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 --pretty=format:'%ci')
64+
CFG_VER_DATE = $(shell git --git-dir='$(CFG_GIT_DIR)' log -1 --date=short --pretty=format:'%cd')
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+
7174
# Windows exe's need numeric versions - don't use anything but
7275
# numbers and dots here
7376
CFG_VERSION_WIN = $(CFG_RELEASE_NUM)
@@ -317,6 +320,7 @@ endif
317320
ifdef CFG_VER_HASH
318321
export CFG_VER_HASH
319322
endif
323+
export CFG_BUILD_DATE
320324
export CFG_VERSION
321325
export CFG_VERSION_WIN
322326
export CFG_RELEASE

branches/beta/src/doc/complement-bugreport.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ $ RUST_BACKTRACE=1 rustc ...
5656

5757
# I submitted a bug, but nobody has commented on it!
5858

59-
This is sad, but does happen sometimes, since we're short-staffed. If you
60-
submit a bug and you haven't received a comment on it within 3 business days,
61-
it's entirely reasonable to either ask on the #rust IRC channel,
62-
or post on the [rust-dev mailing list](https://mail.mozilla.org/listinfo/rust-dev)
63-
to ask what the status of the bug is.
59+
This is sad, but does happen sometimes, since we're short-staffed. If you submit a
60+
bug and you haven't received a comment on it within 3 business days, it's entirely
61+
reasonable to ask about the status of the bug in #rust on irc.mozilla.org.

branches/beta/src/doc/intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ segfault when we allocate more memory?
224224

225225
The answer is that in the C++ version, `x` is a *reference* to the memory
226226
location where the first element of the array is stored. But in Ruby, `x` is a
227-
standalone value, not connected to the underyling array at all. Let's dig into
227+
standalone value, not connected to the underlying array at all. Let's dig into
228228
the details for a moment. Your program has access to memory, provided to it by
229229
the operating system. Each location in memory has an address. So when we make
230230
our vector, `v`, it's stored in a memory location somewhere:

branches/beta/src/doc/reference.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2591,9 +2591,8 @@ of any reference that points to it.
25912591

25922592
When a [local variable](#memory-slots) is used as an
25932593
[rvalue](#lvalues,-rvalues-and-temporaries) the variable will either be moved
2594-
or copied, depending on its type. For types that contain [owning
2595-
pointers](#pointer-types) or values that implement the special trait `Drop`,
2596-
the variable is moved. All other types are copied.
2594+
or copied, depending on its type. All values whose type implements `Copy` are
2595+
copied, all others are moved.
25972596

25982597
### Literal expressions
25992598

@@ -3005,7 +3004,7 @@ Some examples of call expressions:
30053004
# fn add(x: i32, y: i32) -> i32 { 0 }
30063005
30073006
let x: i32 = add(1i32, 2i32);
3008-
let pi: Option<f32> = "3.14".parse().ok();
3007+
let pi: Result<f32, _> = "3.14".parse();
30093008
```
30103009

30113010
### Lambda expressions
@@ -3148,7 +3147,7 @@ An example of a for loop over a series of integers:
31483147

31493148
```
31503149
# fn bar(b:usize) { }
3151-
for i in range(0us, 256) {
3150+
for i in 0us..256 {
31523151
bar(i);
31533152
}
31543153
```
@@ -3532,7 +3531,7 @@ An example of each kind:
35323531
```{rust}
35333532
let vec: Vec<i32> = vec![1, 2, 3];
35343533
let arr: [i32; 3] = [1, 2, 3];
3535-
let s: &[i32] = &vec;
3534+
let s: &[i32] = &vec[];
35363535
```
35373536

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

branches/beta/src/doc/trpl/compound-data-types.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,12 @@ let four_is_smaller = four <= ten;
263263
let four_equals_ten = four == ten;
264264
```
265265

266-
This may seem rather limiting, particularly equality being invalid; in
267-
many cases however, it's unnecessary. Rust provides the [`match`][match]
268-
keyword, which will be examined in more detail in the next section, which
269-
often allows better and easier branch control than a series of `if`/`else`
270-
statements would. However, for our [game][game] we need the comparisons
271-
to work so we will utilize the `Ordering` `enum` provided by the standard
272-
library which supports such comparisons. It has this form:
266+
This may seem rather limiting, but it's a limitation which we can overcome.
267+
There are two ways: by implementing equality ourselves, or by using the
268+
[`match`][match] keyword. We don't know enough about Rust to implement equality
269+
yet, but we can use the `Ordering` enum from the standard library, which does:
273270

274-
```{rust}
271+
```
275272
enum Ordering {
276273
Less,
277274
Equal,

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 range(0, 10) {
357+
for _ in 0..10 {
358358
let tx = tx.clone();
359359
360360
Thread::spawn(move || {

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

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% Rust Documentation
1+
% 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,3 +294,26 @@ 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: Option<u32> = input.parse().ok();
403+
let input_num: Result<u32, _> = input.parse();
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>().ok(); // input_num: Option<u32>
426-
let input_num: Option<u32> = "5".parse().ok(); // input_num: Option<u32>
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>
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: Option<u32> = input.parse().ok();
450+
let input_num: Result<u32, _> = input.parse();
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: Option<u32> = input.parse().ok();
500+
let input_num: Result<u32, _> = input.parse();
501501

502502
let num = match input_num {
503-
Some(num) => num,
504-
None => {
503+
Ok(num) => num,
504+
Err(_) => {
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: Option<u32> = input.trim().parse().ok();
567+
let input_num: Result<u32, _> = input.trim().parse();
568568

569569
let num = match input_num {
570-
Some(num) => num,
571-
None => {
570+
Ok(num) => num,
571+
Err(_) => {
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: Option<u32> = input.trim().parse().ok();
643+
let input_num: Result<u32, _> = input.trim().parse();
644644
645645
let num = match input_num {
646-
Some(num) => num,
647-
None => {
646+
Ok(num) => num,
647+
Err(_) => {
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: Option<u32> = input.trim().parse().ok();
719+
let input_num: Result<u32, _> = input.trim().parse();
720720

721721
let num = match input_num {
722-
Some(num) => num,
723-
None => {
722+
Ok(num) => num,
723+
Err(_) => {
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: Option<u32> = input.trim().parse().ok();
775+
let input_num: Result<u32, _> = input.trim().parse();
776776

777777
let num = match input_num {
778-
Some(num) => num,
779-
None => {
778+
Ok(num) => num,
779+
Err(_) => {
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: Option<u32> = input.trim().parse().ok();
852+
let input_num: Result<u32, _> = input.trim().parse();
853853

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

0 commit comments

Comments
 (0)