Skip to content

Commit 9078b7e

Browse files
committed
---
yaml --- r: 193631 b: refs/heads/beta c: dbec033 h: refs/heads/master i: 193629: 498d54d 193627: bcbaa21 193623: ffedb7c 193615: b064283 193599: 12606cc v: v3
1 parent 345f1ec commit 9078b7e

File tree

237 files changed

+1569
-3533
lines changed

Some content is hidden

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

237 files changed

+1569
-3533
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: b83b26bacb6371173cdec6bf68c7ffa69f858c84
34+
refs/heads/beta: dbec033e29417ab01bae5749b58f8866b300f005
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

branches/beta/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ The Rust community congregates in a few places:
115115

116116
## Contributing
117117

118-
To contribute to Rust, please see [CONTRIBUTING](CONTRIBUTING.md).
118+
To contribute to Rust, please see [CONTRIBUTING.md](CONTRIBUTING.md).
119119

120120
Rust has an [IRC] culture and most real-time collaboration happens in a
121121
variety of channels on Mozilla's IRC network, irc.mozilla.org. The
@@ -131,4 +131,4 @@ Rust is primarily distributed under the terms of both the MIT license
131131
and the Apache License (Version 2.0), with portions covered by various
132132
BSD-like licenses.
133133
134-
See [LICENSE-APACHE](LICENSE-APACHE), [LICENSE-MIT](LICENSE-MIT), and [COPYRIGHT](COPYRIGHT) for details.
134+
See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.

branches/beta/configure

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,6 @@ case $CFG_OSTYPE in
430430
CFG_CPUTYPE=x86_64
431431
;;
432432

433-
# Win 8 # uname -s on 64-bit cygwin does not contain WOW64, so simply use uname -m to detect arch (works in my install)
434-
CYGWIN_NT-6.3)
435-
CFG_OSTYPE=pc-windows-gnu
436-
;;
437433
# We do not detect other OS such as XP/2003 using 64 bit using uname.
438434
# If we want to in the future, we will need to use Cygwin - Chuck's csih helper in /usr/lib/csih/winProductName.exe or alternative.
439435
*)

branches/beta/mk/main.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ CFG_RELEASE_NUM=1.0.0
1818
# An optional number to put after the label, e.g. '.2' -> '-beta.2'
1919
# NB Make sure it starts with a dot to conform to semver pre-release
2020
# versions (section 9)
21-
CFG_PRERELEASE_VERSION=
21+
CFG_PRERELEASE_VERSION=.2
2222

2323
CFG_FILENAME_EXTRA=4e7c5e5c
2424

@@ -30,8 +30,8 @@ CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)
3030
CFG_DISABLE_UNSTABLE_FEATURES=1
3131
endif
3232
ifeq ($(CFG_RELEASE_CHANNEL),beta)
33-
CFG_RELEASE=$(CFG_RELEASE_NUM)-beta(CFG_PRERELEASE_VERSION)
34-
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-beta(CFG_PRERELEASE_VERSION)
33+
CFG_RELEASE=$(CFG_RELEASE_NUM)-alpha$(CFG_PRERELEASE_VERSION)
34+
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-alpha$(CFG_PRERELEASE_VERSION)
3535
CFG_DISABLE_UNSTABLE_FEATURES=1
3636
endif
3737
ifeq ($(CFG_RELEASE_CHANNEL),nightly)

branches/beta/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
590590

591591
# The tests select when to use debug configuration on their own;
592592
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
593-
CTEST_RUSTC_FLAGS := $$(subst -C debug-assertions,,$$(CFG_RUSTC_FLAGS))
593+
CTEST_RUSTC_FLAGS := $$(subst --cfg ndebug,,$$(CFG_RUSTC_FLAGS))
594594

595595
# The tests cannot be optimized while the rest of the compiler is optimized, so
596596
# filter out the optimization (if any) from rustc and then figure out if we need

branches/beta/src/compiletest/compiletest.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@
2222
#![feature(unicode)]
2323
#![feature(core)]
2424
#![feature(path)]
25+
#![feature(os)]
2526
#![feature(io)]
27+
#![feature(fs)]
2628
#![feature(net)]
27-
#![feature(path_ext)]
2829

2930
#![deny(warnings)]
3031

@@ -332,7 +333,7 @@ pub fn make_test<F>(config: &Config, testfile: &Path, f: F) -> test::TestDescAnd
332333
desc: test::TestDesc {
333334
name: make_test_name(config, testfile),
334335
ignore: header::is_test_ignored(config, testfile),
335-
should_panic: test::ShouldPanic::No,
336+
should_fail: test::ShouldFail::No,
336337
},
337338
testfn: f(),
338339
}

branches/beta/src/compiletest/runtest.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use procsrv;
2020
use util::logv;
2121

2222
use std::env;
23+
use std::ffi::OsStr;
2324
use std::fmt;
2425
use std::fs::{self, File};
2526
use std::io::BufReader;
@@ -1322,7 +1323,7 @@ fn make_exe_name(config: &Config, testfile: &Path) -> PathBuf {
13221323
let mut f = output_base_name(config, testfile);
13231324
if !env::consts::EXE_SUFFIX.is_empty() {
13241325
let mut fname = f.file_name().unwrap().to_os_string();
1325-
fname.push(env::consts::EXE_SUFFIX);
1326+
fname.push_os_str(OsStr::from_str(env::consts::EXE_SUFFIX));
13261327
f.set_file_name(&fname);
13271328
}
13281329
f
@@ -1432,7 +1433,7 @@ fn make_out_name(config: &Config, testfile: &Path, extension: &str) -> PathBuf {
14321433
fn aux_output_dir_name(config: &Config, testfile: &Path) -> PathBuf {
14331434
let f = output_base_name(config, testfile);
14341435
let mut fname = f.file_name().unwrap().to_os_string();
1435-
fname.push("libaux");
1436+
fname.push_os_str(OsStr::from_str("libaux"));
14361437
f.with_file_name(&fname)
14371438
}
14381439

@@ -1646,8 +1647,8 @@ fn append_suffix_to_stem(p: &Path, suffix: &str) -> PathBuf {
16461647
p.to_path_buf()
16471648
} else {
16481649
let mut stem = p.file_stem().unwrap().to_os_string();
1649-
stem.push("-");
1650-
stem.push(suffix);
1650+
stem.push_os_str(OsStr::from_str("-"));
1651+
stem.push_os_str(OsStr::from_str(suffix));
16511652
p.with_file_name(&stem)
16521653
}
16531654
}

branches/beta/src/doc/grammar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ field_expr : expr '.' ident ;
514514
### Array expressions
515515

516516
```antlr
517-
array_expr : '[' "mut" ? array_elems? ']' ;
517+
array_expr : '[' "mut" ? vec_elems? ']' ;
518518
519519
array_elems : [expr [',' expr]*] | [expr ',' ".." expr] ;
520520
```

branches/beta/src/doc/guide-tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
% The (old) Rust Threads and Communication Guide
22

33
This content has moved into
4-
[the Rust Programming Language book](book/concurrency.html).
4+
[the Rust Programming Language book](book/tasks.html).

branches/beta/src/doc/intro.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -389,11 +389,11 @@ safe concurrent programs.
389389
Here's an example of a concurrent Rust program:
390390
391391
```{rust}
392-
use std::thread;
392+
use std::thread::Thread;
393393
394394
fn main() {
395395
let guards: Vec<_> = (0..10).map(|_| {
396-
thread::scoped(|| {
396+
Thread::scoped(|| {
397397
println!("Hello, world!");
398398
})
399399
}).collect();
@@ -421,16 +421,16 @@ problem.
421421
Let's see an example. This Rust code will not compile:
422422
423423
```{rust,ignore}
424-
use std::thread;
424+
use std::thread::Thread;
425425
426426
fn main() {
427427
let mut numbers = vec![1, 2, 3];
428428
429429
let guards: Vec<_> = (0..3).map(|i| {
430-
thread::scoped(move || {
430+
Thread::scoped(move || {
431431
numbers[i] += 1;
432432
println!("numbers[{}] is {}", i, numbers[i]);
433-
})
433+
});
434434
}).collect();
435435
}
436436
```
@@ -439,10 +439,10 @@ It gives us this error:
439439
440440
```text
441441
7:25: 10:6 error: cannot move out of captured outer variable in an `FnMut` closure
442-
7 thread::scoped(move || {
442+
7 Thread::scoped(move || {
443443
8 numbers[i] += 1;
444444
9 println!("numbers[{}] is {}", i, numbers[i]);
445-
10 })
445+
10 });
446446
error: aborting due to previous error
447447
```
448448
@@ -471,19 +471,19 @@ mutation doesn't cause a data race.
471471
Here's what using an Arc with a Mutex looks like:
472472
473473
```{rust}
474-
use std::thread;
474+
use std::thread::Thread;
475475
use std::sync::{Arc,Mutex};
476476
477477
fn main() {
478478
let numbers = Arc::new(Mutex::new(vec![1, 2, 3]));
479479
480480
let guards: Vec<_> = (0..3).map(|i| {
481481
let number = numbers.clone();
482-
thread::scoped(move || {
482+
Thread::scoped(move || {
483483
let mut array = number.lock().unwrap();
484484
array[i] += 1;
485485
println!("numbers[{}] is {}", i, array[i]);
486-
})
486+
});
487487
}).collect();
488488
}
489489
```
@@ -535,15 +535,15 @@ As an example, Rust's ownership system is _entirely_ at compile time. The
535535
safety check that makes this an error about moved values:
536536
537537
```{rust,ignore}
538-
use std::thread;
538+
use std::thread::Thread;
539539
540540
fn main() {
541541
let numbers = vec![1, 2, 3];
542542
543543
let guards: Vec<_> = (0..3).map(|i| {
544-
thread::scoped(move || {
544+
Thread::scoped(move || {
545545
println!("{}", numbers[i]);
546-
})
546+
});
547547
}).collect();
548548
}
549549
```

branches/beta/src/doc/reference.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2429,10 +2429,6 @@ The currently implemented features of the reference compiler are:
24292429
so that new attributes can be added in a bacwards compatible
24302430
manner (RFC 572).
24312431

2432-
* `custom_derive` - Allows the use of `#[derive(Foo,Bar)]` as sugar for
2433-
`#[derive_Foo] #[derive_Bar]`, which can be user-defined syntax
2434-
extensions.
2435-
24362432
* `intrinsics` - Allows use of the "rust-intrinsics" ABI. Compiler intrinsics
24372433
are inherently unstable and no promise about them is made.
24382434

@@ -2847,7 +2843,7 @@ automatically dereferenced to make the field access possible.
28472843
### Array expressions
28482844

28492845
```{.ebnf .gram}
2850-
array_expr : '[' "mut" ? array_elems? ']' ;
2846+
array_expr : '[' "mut" ? vec_elems? ']' ;
28512847
28522848
array_elems : [expr [',' expr]*] | [expr ';' expr] ;
28532849
```
@@ -3007,6 +3003,10 @@ A type cast expression is denoted with the binary operator `as`.
30073003
Executing an `as` expression casts the value on the left-hand side to the type
30083004
on the right-hand side.
30093005

3006+
A numeric value can be cast to any numeric type. A raw pointer value can be
3007+
cast to or from any integral type or raw pointer type. Any other cast is
3008+
unsupported and will fail to compile.
3009+
30103010
An example of an `as` expression:
30113011

30123012
```

branches/beta/src/doc/style/errors/ergonomics.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ fn write_info(info: &Info) -> Result<(), IoError> {
2222
let mut file = File::open_mode(&Path::new("my_best_friends.txt"),
2323
Open, Write);
2424
// Early return on error
25-
try!(file.write_line(&format!("name: {}", info.name)));
26-
try!(file.write_line(&format!("age: {}", info.age)));
27-
try!(file.write_line(&format!("rating: {}", info.rating)));
25+
try!(file.write_line(format!("name: {}", info.name).as_slice()));
26+
try!(file.write_line(format!("age: {}", info.age).as_slice()));
27+
try!(file.write_line(format!("rating: {}", info.rating).as_slice()));
2828
return Ok(());
2929
}
3030
```
@@ -44,15 +44,15 @@ fn write_info(info: &Info) -> Result<(), IoError> {
4444
let mut file = File::open_mode(&Path::new("my_best_friends.txt"),
4545
Open, Write);
4646
// Early return on error
47-
match file.write_line(&format!("name: {}", info.name)) {
47+
match file.write_line(format!("name: {}", info.name).as_slice()) {
4848
Ok(_) => (),
4949
Err(e) => return Err(e)
5050
}
51-
match file.write_line(&format!("age: {}", info.age)) {
51+
match file.write_line(format!("age: {}", info.age).as_slice()) {
5252
Ok(_) => (),
5353
Err(e) => return Err(e)
5454
}
55-
return file.write_line(&format!("rating: {}", info.rating));
55+
return file.write_line(format!("rating: {}", info.rating).as_slice());
5656
}
5757
```
5858

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
* [Standard Input](standard-input.md)
1717
* [Guessing Game](guessing-game.md)
1818
* [II: Intermediate Rust](intermediate.md)
19+
* [More Strings](more-strings.md)
1920
* [Crates and Modules](crates-and-modules.md)
2021
* [Testing](testing.md)
2122
* [Pointers](pointers.md)
2223
* [Ownership](ownership.md)
23-
* [More Strings](more-strings.md)
2424
* [Patterns](patterns.md)
2525
* [Method Syntax](method-syntax.md)
2626
* [Closures](closures.md)

branches/beta/src/doc/trpl/arrays-vectors-and-slices.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@ let v = vec![1, 2, 3]; // v: Vec<i32>
6060
brackets `[]` with `vec!`. Rust allows you to use either in either situation,
6161
this is just convention.)
6262

63-
There's an alternate form of `vec!` for repeating an initial value:
64-
65-
```
66-
let v = vec![0; 10]; // ten zeroes
67-
```
68-
6963
You can get the length of, iterate over, and subscript vectors just like
7064
arrays. In addition, (mutable) vectors can grow automatically:
7165

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,15 @@ method which has this signature:
223223
fn lock(&self) -> LockResult<MutexGuard<T>>
224224
```
225225

226-
Because `Send` is not implemented for `MutexGuard<T>`, we can't transfer the
227-
guard across thread boundaries, which gives us our error.
226+
If we [look at the code for MutexGuard](https://github.com/rust-lang/rust/blob/ca4b9674c26c1de07a2042cb68e6a062d7184cef/src/libstd/sync/mutex.rs#L172), we'll see
227+
this:
228+
229+
```ignore
230+
__marker: marker::NoSend,
231+
```
232+
233+
Because our guard is `NoSend`, it's not `Send`. Which means we can't actually
234+
transfer the guard across thread boundaries, which gives us our error.
228235

229236
We can use `Arc<T>` to fix this. Here's the working version:
230237

0 commit comments

Comments
 (0)