Skip to content

Commit 3edc951

Browse files
committed
---
yaml --- r: 192139 b: refs/heads/master c: 0c040b0 h: refs/heads/master i: 192137: c009d10 192135: eee5da1 v: v3
1 parent af34f0d commit 3edc951

File tree

126 files changed

+628
-920
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

+628
-920
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: 809a554fca2d0ebc2ba50077016fe282a4064752
2+
refs/heads/master: 0c040b07f00f8cb1e59c4811c59e2adf81e6e167
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a923278c6278c63468d74772c58dbf788e88f58c
55
refs/heads/try: ce76bff75603a754d092456285ff455eb871633d

trunk/man/rustc.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ full debug info with variable and type information.
242242
\fBopt\-level\fR=\fIVAL\fR
243243
Optimize with possible levels 0\[en]3
244244

245-
.SH ENVIRONMENT
245+
.SH ENVIRONMENT VARIABLES
246246

247247
Some of these affect the output of the compiler, while others affect programs
248248
which link to the standard library.

trunk/src/compiletest/procsrv.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010

1111
#![allow(deprecated)] // for old path, for dynamic_lib
1212

13-
use std::dynamic_lib::DynamicLibrary;
14-
use std::io::prelude::*;
15-
use std::old_path::Path;
1613
use std::process::{ExitStatus, Command, Child, Output, Stdio};
14+
use std::io::prelude::*;
15+
use std::dynamic_lib::DynamicLibrary;
1716

1817
fn add_target_env(cmd: &mut Command, lib_path: &str, aux_path: Option<&str>) {
1918
// Need to be sure to put both the lib_path and the aux path in the dylib

trunk/src/doc/reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,7 +1982,7 @@ the namespace hierarchy as it normally would.
19821982
## Attributes
19831983

19841984
```{.ebnf .gram}
1985-
attribute : '#' '!' ? '[' meta_item ']' ;
1985+
attribute : "#!" ? '[' meta_item ']' ;
19861986
meta_item : ident [ '=' literal
19871987
| '(' meta_seq ')' ] ? ;
19881988
meta_seq : meta_item [ ',' meta_seq ] ? ;
@@ -3158,7 +3158,7 @@ ten_times(|j| println!("hello, {}", j));
31583158
### While loops
31593159

31603160
```{.ebnf .gram}
3161-
while_expr : [ lifetime ':' ] "while" no_struct_literal_expr '{' block '}' ;
3161+
while_expr : "while" no_struct_literal_expr '{' block '}' ;
31623162
```
31633163

31643164
A `while` loop begins by evaluating the boolean loop conditional expression.
@@ -3223,7 +3223,7 @@ A `continue` expression is only permitted in the body of a loop.
32233223
### For expressions
32243224

32253225
```{.ebnf .gram}
3226-
for_expr : [ lifetime ':' ] "for" pat "in" no_struct_literal_expr '{' block '}' ;
3226+
for_expr : "for" pat "in" no_struct_literal_expr '{' block '}' ;
32273227
```
32283228

32293229
A `for` expression is a syntactic construct for looping over elements provided

trunk/src/doc/trpl/SUMMARY.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Summary
22

3-
* [The Basics](basic.md)
3+
* [I: The Basics](basic.md)
44
* [Installing Rust](installing-rust.md)
55
* [Hello, world!](hello-world.md)
66
* [Hello, Cargo!](hello-cargo.md)
@@ -14,7 +14,7 @@
1414
* [Strings](strings.md)
1515
* [Arrays, Vectors, and Slices](arrays-vectors-and-slices.md)
1616
* [Standard Input](standard-input.md)
17-
* [Intermediate Rust](intermediate.md)
17+
* [II: Intermediate Rust](intermediate.md)
1818
* [Crates and Modules](crates-and-modules.md)
1919
* [Testing](testing.md)
2020
* [Pointers](pointers.md)
@@ -31,7 +31,7 @@
3131
* [Concurrency](concurrency.md)
3232
* [Error Handling](error-handling.md)
3333
* [Documentation](documentation.md)
34-
* [Advanced Topics](advanced.md)
34+
* [III: Advanced Topics](advanced.md)
3535
* [FFI](ffi.md)
3636
* [Unsafe Code](unsafe.md)
3737
* [Advanced Macros](advanced-macros.md)

trunk/src/doc/trpl/compound-data-types.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ This pattern is very powerful, and we'll see it repeated more later.
4747

4848
There are also a few things you can do with a tuple as a whole, without
4949
destructuring. You can assign one tuple into another, if they have the same
50-
contained types and arity. Tuples have the same arity when they have the same
50+
contained types and [arity]. Tuples have the same arity when they have the same
5151
length.
5252

5353
```rust
@@ -357,6 +357,7 @@ tool that will let us deconstruct this sum type (the type theory term for enums)
357357
in a very elegant way and avoid all these messy `if`/`else`s.
358358

359359

360+
[arity]: ./glossary.html#arity
360361
[match]: ./match.html
361362
[game]: ./guessing-game.html#comparing-guesses
362363
[generics]: ./generics.html

trunk/src/doc/trpl/concurrency.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ us enforce that it can't leave the current thread.
4040

4141
### `Sync`
4242

43-
The second of these two trait is called [`Sync`](../std/marker/trait.Sync.html).
43+
The second of these traits is called [`Sync`](../std/marker/trait.Sync.html).
4444
When a type `T` implements `Sync`, it indicates to the compiler that something
4545
of this type has no possibility of introducing memory unsafety when used from
4646
multiple threads concurrently.
4747

4848
For example, sharing immutable data with an atomic reference count is
4949
threadsafe. Rust provides a type like this, `Arc<T>`, and it implements `Sync`,
50-
so that it could be safely shared between threads.
50+
so it is safe to share between threads.
5151

5252
These two traits allow you to use the type system to make strong guarantees
5353
about the properties of your code under concurrency. Before we demonstrate
@@ -69,7 +69,7 @@ fn main() {
6969
}
7070
```
7171

72-
The `Thread::scoped()` method accepts a closure, which is executed in a new
72+
The `thread::scoped()` method accepts a closure, which is executed in a new
7373
thread. It's called `scoped` because this thread returns a join guard:
7474

7575
```
@@ -208,10 +208,10 @@ Here's the error:
208208

209209
```text
210210
<anon>:11:9: 11:22 error: the trait `core::marker::Send` is not implemented for the type `std::sync::mutex::MutexGuard<'_, collections::vec::Vec<u32>>` [E0277]
211-
<anon>:11 Thread::spawn(move || {
211+
<anon>:11 thread::spawn(move || {
212212
^~~~~~~~~~~~~
213213
<anon>:11:9: 11:22 note: `std::sync::mutex::MutexGuard<'_, collections::vec::Vec<u32>>` cannot be sent between threads safely
214-
<anon>:11 Thread::spawn(move || {
214+
<anon>:11 thread::spawn(move || {
215215
^~~~~~~~~~~~~
216216
```
217217

@@ -322,7 +322,6 @@ While this channel is just sending a generic signal, we can send any data that
322322
is `Send` over the channel!
323323

324324
```
325-
use std::sync::{Arc, Mutex};
326325
use std::thread;
327326
use std::sync::mpsc;
328327

trunk/src/doc/trpl/crates-and-modules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ fn main() {
430430
}
431431
```
432432
433-
But it is not idiomatic. This is significantly more likely to introducing a
433+
But it is not idiomatic. This is significantly more likely to introduce a
434434
naming conflict. In our short program, it's not a big deal, but as it grows, it
435435
becomes a problem. If we have conflicting names, Rust will give a compilation
436436
error. For example, if we made the `japanese` functions public, and tried to do

trunk/src/doc/trpl/standard-input.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ doesn't work, so we're okay with that. In most cases, we would want to handle
115115
the error case explicitly. `expect()` allows us to give an error message if
116116
this crash happens.
117117

118-
We will cover the exact details of how all of this works later in the Guide.
119-
For now, this gives you enough of a basic understanding to work with.
118+
We will cover the exact details of how all of this works later in the Guide in
119+
[Error Handling]. For now, this gives you enough of a basic understanding to
120+
work with.
120121

121122
Back to the code we were working on! Here's a refresher:
122123

@@ -157,3 +158,6 @@ here.
157158

158159
That's all you need to get basic input from the standard input! It's not too
159160
complicated, but there are a number of small parts.
161+
162+
163+
[Error Handling]: ./error-handling.html

trunk/src/libcollections/btree/map.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use core::default::Default;
2424
use core::fmt::Debug;
2525
use core::hash::{Hash, Hasher};
2626
use core::iter::{Map, FromIterator, IntoIterator};
27-
use core::ops::{Index};
27+
use core::ops::{Index, IndexMut};
2828
use core::{iter, fmt, mem, usize};
2929
use Bound::{self, Included, Excluded, Unbounded};
3030

@@ -925,6 +925,15 @@ impl<K: Ord, Q: ?Sized, V> Index<Q> for BTreeMap<K, V>
925925
}
926926
}
927927

928+
#[stable(feature = "rust1", since = "1.0.0")]
929+
impl<K: Ord, Q: ?Sized, V> IndexMut<Q> for BTreeMap<K, V>
930+
where K: Borrow<Q>, Q: Ord
931+
{
932+
fn index_mut(&mut self, key: &Q) -> &mut V {
933+
self.get_mut(key).expect("no entry found for key")
934+
}
935+
}
936+
928937
/// Genericises over how to get the correct type of iterator from the correct type
929938
/// of Node ownership.
930939
trait Traverse<N> {

trunk/src/libcollections/fmt.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@
262262
//!
263263
//! ```
264264
//! # #![allow(unused_must_use)]
265-
//! use std::io::Write;
266265
//! let mut w = Vec::new();
267266
//! write!(&mut w, "Hello {}!", "world");
268267
//! ```
@@ -289,15 +288,15 @@
289288
//!
290289
//! ```
291290
//! use std::fmt;
292-
//! use std::io::{self, Write};
291+
//! use std::old_io;
293292
//!
294293
//! fmt::format(format_args!("this returns {}", "String"));
295294
//!
296-
//! let mut some_writer = io::stdout();
295+
//! let mut some_writer = old_io::stdout();
297296
//! write!(&mut some_writer, "{}", format_args!("print with a {}", "macro"));
298297
//!
299298
//! fn my_fmt_fn(args: fmt::Arguments) {
300-
//! write!(&mut io::stdout(), "{}", args);
299+
//! write!(&mut old_io::stdout(), "{}", args);
301300
//! }
302301
//! my_fmt_fn(format_args!("or a {} too", "function"));
303302
//! ```

trunk/src/libcore/macros.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ macro_rules! try {
176176
///
177177
/// ```
178178
/// # #![allow(unused_must_use)]
179-
/// use std::io::Write;
180179
///
181180
/// let mut w = Vec::new();
182181
/// write!(&mut w, "test");

trunk/src/libcore/prelude.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ pub use marker::{Copy, Send, Sized, Sync};
2929
pub use ops::{Drop, Fn, FnMut, FnOnce};
3030

3131
// Reexported functions
32+
#[allow(deprecated)]
33+
pub use iter::range;
3234
pub use mem::drop;
3335

3436
// Reexported types and traits

trunk/src/libcore/result.rs

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
//! let bad_result: Result<int, int> = bad_result.or_else(|i| Ok(11));
7979
//!
8080
//! // Consume the result and return the contents with `unwrap`.
81-
//! let final_awesome_result = good_result.unwrap();
81+
//! let final_awesome_result = good_result.ok().unwrap();
8282
//! ```
8383
//!
8484
//! # Results must be used
@@ -110,8 +110,7 @@
110110
//! something like this:
111111
//!
112112
//! ```{.ignore}
113-
//! use std::old_io::*;
114-
//! use std::old_path::Path;
113+
//! use std::old_io::{File, Open, Write};
115114
//!
116115
//! let mut file = File::open_mode(&Path::new("valuable_data.txt"), Open, Write);
117116
//! // If `write_line` errors, then we'll never know, because the return
@@ -129,8 +128,7 @@
129128
//! a marginally useful message indicating why:
130129
//!
131130
//! ```{.no_run}
132-
//! use std::old_io::*;
133-
//! use std::old_path::Path;
131+
//! use std::old_io::{File, Open, Write};
134132
//!
135133
//! let mut file = File::open_mode(&Path::new("valuable_data.txt"), Open, Write);
136134
//! file.write_line("important message").ok().expect("failed to write message");
@@ -140,8 +138,7 @@
140138
//! You might also simply assert success:
141139
//!
142140
//! ```{.no_run}
143-
//! # use std::old_io::*;
144-
//! # use std::old_path::Path;
141+
//! # use std::old_io::{File, Open, Write};
145142
//!
146143
//! # let mut file = File::open_mode(&Path::new("valuable_data.txt"), Open, Write);
147144
//! assert!(file.write_line("important message").is_ok());
@@ -151,8 +148,7 @@
151148
//! Or propagate the error up the call stack with `try!`:
152149
//!
153150
//! ```
154-
//! # use std::old_io::*;
155-
//! # use std::old_path::Path;
151+
//! # use std::old_io::{File, Open, Write, IoError};
156152
//! fn write_message() -> Result<(), IoError> {
157153
//! let mut file = File::open_mode(&Path::new("valuable_data.txt"), Open, Write);
158154
//! try!(file.write_line("important message"));
@@ -171,8 +167,7 @@
171167
//! It replaces this:
172168
//!
173169
//! ```
174-
//! use std::old_io::*;
175-
//! use std::old_path::Path;
170+
//! use std::old_io::{File, Open, Write, IoError};
176171
//!
177172
//! struct Info {
178173
//! name: String,
@@ -196,8 +191,7 @@
196191
//! With this:
197192
//!
198193
//! ```
199-
//! use std::old_io::*;
200-
//! use std::old_path::Path;
194+
//! use std::old_io::{File, Open, Write, IoError};
201195
//!
202196
//! struct Info {
203197
//! name: String,
@@ -452,7 +446,7 @@ impl<T, E> Result<T, E> {
452446
/// ignoring I/O and parse errors:
453447
///
454448
/// ```
455-
/// use std::old_io::*;
449+
/// use std::old_io::IoResult;
456450
///
457451
/// let mut buffer: &[u8] = b"1\n2\n3\n4\n";
458452
/// let mut buffer = &mut buffer;
@@ -466,7 +460,7 @@ impl<T, E> Result<T, E> {
466460
/// line.trim_right().parse::<int>().unwrap_or(0)
467461
/// });
468462
/// // Add the value if there were no errors, otherwise add 0
469-
/// sum += val.unwrap_or(0);
463+
/// sum += val.ok().unwrap_or(0);
470464
/// }
471465
///
472466
/// assert!(sum == 10);

trunk/src/libcoretest/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn test_bool_from_str() {
3535
fn check_contains_all_substrings(s: &str) {
3636
assert!(s.contains(""));
3737
for i in 0..s.len() {
38-
for j in i+1..s.len() + 1 {
38+
for j in range(i+1, s.len() + 1) {
3939
assert!(s.contains(&s[i..j]));
4040
}
4141
}

0 commit comments

Comments
 (0)