Skip to content

Commit 04eca61

Browse files
committed
---
yaml --- r: 274215 b: refs/heads/stable c: ac27ec2 h: refs/heads/master i: 274213: 0d6bee1 274211: 0f92959 274207: d9fdc15
1 parent a2611e9 commit 04eca61

File tree

21 files changed

+40
-164
lines changed

21 files changed

+40
-164
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 4d99bad15870131a9131a58dfba297e44b1c930b
32+
refs/heads/stable: ac27ec2a4877fcbf778e103022c5e654f8c248b0
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/doc/book/bibliography.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,3 @@ Language](http://www.cs.indiana.edu/~eholk/papers/hips2013.pdf). Early GPU work
8080
Rust](http://munksgaard.me/papers/laumann-munksgaard-larsen.pdf). Philip
8181
Munksgaard's master's thesis. Research for Servo.
8282
* [Ownership is Theft: Experiences Building an Embedded OS in Rust - Amit Levy, et. al.](http://amitlevy.com/papers/tock-plos2015.pdf)
83-
* [You can't spell trust without Rust](https://raw.githubusercontent.com/Gankro/thesis/master/thesis.pdf). Alexis Beingessner's master's thesis.

branches/stable/src/doc/book/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ If we're on Linux or a Mac, all we need to do is open a terminal and type this:
111111
$ curl -sSf https://static.rust-lang.org/rustup.sh | sh
112112
```
113113

114-
This will download a script, and start the installation. If it all goes well,
114+
This will download a script, and stat the installation. If it all goes well,
115115
you’ll see this appear:
116116

117117
```text

branches/stable/src/doc/book/guessing-game.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,6 @@ let guess: u32 = match guess.trim().parse() {
908908
```
909909
910910
This is how you generally move from ‘crash on error’ to ‘actually handle the
911-
error’, by switching from `expect()` to a `match` statement. The `Result`
912911
returned by `parse()` is an `enum` like `Ordering`, but in this case, each
913912
variant has some data associated with it: `Ok` is a success, and `Err` is a
914913
failure. Each contains more information: the successfully parsed integer, or an

branches/stable/src/doc/book/no-stdlib.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,10 @@ The compiler currently makes a few assumptions about symbols which are available
7777
in the executable to call. Normally these functions are provided by the standard
7878
library, but without it you must define your own.
7979

80-
The first of these two functions, `eh_personality`, is used by the failure
81-
mechanisms of the compiler. This is often mapped to GCC's personality function
82-
(see the [libstd implementation][unwind] for more information), but crates
83-
which do not trigger a panic can be assured that this function is never
84-
called. The second function, `panic_fmt`, is also used by the failure
85-
mechanisms of the compiler.
86-
87-
[unwind]: https://github.com/rust-lang/rust/blob/master/src/libstd/sys/common/unwind/gcc.rs
80+
The first of these two functions, `eh_personality`, is used by the
81+
failure mechanisms of the compiler. This is often mapped to GCC's
82+
personality function (see the
83+
[libstd implementation](../std/rt/unwind/index.html) for more
84+
information), but crates which do not trigger a panic can be assured
85+
that this function is never called. The second function, `panic_fmt`, is
86+
also used by the failure mechanisms of the compiler.

branches/stable/src/doc/book/traits.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -277,22 +277,16 @@ This will compile without error.
277277
This means that even if someone does something bad like add methods to `i32`,
278278
it won’t affect you, unless you `use` that trait.
279279

280-
There’s one more restriction on implementing traits: either the trait
281-
or the type you’re implementing it for must be defined by you. Or more
282-
precisely, one of them must be defined in the same crate as the `impl`
283-
you're writing. For more on Rust's module and package system, see the
284-
chapter on [crates and modules][cm].
285-
286-
So, we could implement the `HasArea` type for `i32`, because we defined
287-
`HasArea` in our code. But if we tried to implement `ToString`, a trait
288-
provided by Rust, for `i32`, we could not, because neither the trait nor
289-
the type are defined in our crate.
280+
There’s one more restriction on implementing traits: either the trait, or the
281+
type you’re writing the `impl` for, must be defined by you. So, we could
282+
implement the `HasArea` type for `i32`, because `HasArea` is in our code. But
283+
if we tried to implement `ToString`, a trait provided by Rust, for `i32`, we could
284+
not, because neither the trait nor the type are in our code.
290285

291286
One last thing about traits: generic functions with a trait bound use
292287
‘monomorphization’ (mono: one, morph: form), so they are statically dispatched.
293288
What’s that mean? Check out the chapter on [trait objects][to] for more details.
294289

295-
[cm]: crates-and-modules.html
296290
[to]: trait-objects.html
297291

298292
# Multiple trait bounds

branches/stable/src/doc/version_info.html.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div id="versioninfo">
2-
<img src="https://www.rust-lang.org/logos/rust-logo-32x32-blk.png" width="32" height="32" alt="Rust logo"><br>
2+
<img src="https://www.rust-lang.org/logos/rust-logo-32x32-blk.png" width="32" height="32" alt><br>
33
<span class="white-sticker"><a href="https://www.rust-lang.org">Rust</a> VERSION</span><br>
44
<a href="https://github.com/rust-lang/rust/commit/STAMP"
55
class="hash white-sticker">SHORT_HASH</a>

branches/stable/src/libcollections/btree/map.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,17 +1194,17 @@ unsafe fn unwrap_unchecked<T>(val: Option<T>) -> T {
11941194
}
11951195

11961196
impl<K, V> BTreeMap<K, V> {
1197-
/// Gets an iterator over the entries of the map, sorted by key.
1197+
/// Gets an iterator over the entries of the map.
11981198
///
11991199
/// # Examples
12001200
///
12011201
/// ```
12021202
/// use std::collections::BTreeMap;
12031203
///
12041204
/// let mut map = BTreeMap::new();
1205-
/// map.insert(3, "c");
1206-
/// map.insert(2, "b");
12071205
/// map.insert(1, "a");
1206+
/// map.insert(2, "b");
1207+
/// map.insert(3, "c");
12081208
///
12091209
/// for (key, value) in map.iter() {
12101210
/// println!("{}: {}", key, value);
@@ -1224,7 +1224,7 @@ impl<K, V> BTreeMap<K, V> {
12241224
}
12251225
}
12261226

1227-
/// Gets a mutable iterator over the entries of the map, sorted by key.
1227+
/// Gets a mutable iterator over the entries of the map.
12281228
///
12291229
/// # Examples
12301230
///
@@ -1257,16 +1257,16 @@ impl<K, V> BTreeMap<K, V> {
12571257
}
12581258
}
12591259

1260-
/// Gets an iterator over the keys of the map, in sorted order.
1260+
/// Gets an iterator over the keys of the map.
12611261
///
12621262
/// # Examples
12631263
///
12641264
/// ```
12651265
/// use std::collections::BTreeMap;
12661266
///
12671267
/// let mut a = BTreeMap::new();
1268-
/// a.insert(2, "b");
12691268
/// a.insert(1, "a");
1269+
/// a.insert(2, "b");
12701270
///
12711271
/// let keys: Vec<_> = a.keys().cloned().collect();
12721272
/// assert_eq!(keys, [1, 2]);
@@ -1276,19 +1276,19 @@ impl<K, V> BTreeMap<K, V> {
12761276
Keys { inner: self.iter() }
12771277
}
12781278

1279-
/// Gets an iterator over the values of the map, in order by key.
1279+
/// Gets an iterator over the values of the map.
12801280
///
12811281
/// # Examples
12821282
///
12831283
/// ```
12841284
/// use std::collections::BTreeMap;
12851285
///
12861286
/// let mut a = BTreeMap::new();
1287-
/// a.insert(1, "hello");
1288-
/// a.insert(2, "goodbye");
1287+
/// a.insert(1, "a");
1288+
/// a.insert(2, "b");
12891289
///
12901290
/// let values: Vec<&str> = a.values().cloned().collect();
1291-
/// assert_eq!(values, ["hello", "goodbye"]);
1291+
/// assert_eq!(values, ["a", "b"]);
12921292
/// ```
12931293
#[stable(feature = "rust1", since = "1.0.0")]
12941294
pub fn values<'a>(&'a self) -> Values<'a, K, V> {

branches/stable/src/librustc_borrowck/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ fn main() {
124124
let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));
125125
let y = x.clone();
126126
x.borrow_mut().s = 6;
127-
println!("{}", x.borrow().s);
127+
println!("{}", x.borrow.s);
128128
}
129129
```
130130

branches/stable/src/librustc_resolve/diagnostics.rs

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -207,41 +207,7 @@ https://doc.rust-lang.org/reference.html#statements
207207
E0317: r##"
208208
User-defined types or type parameters cannot shadow the primitive types.
209209
This error indicates you tried to define a type, struct or enum with the same
210-
name as an existing primitive type:
211-
212-
```
213-
struct u8 {
214-
// ...
215-
}
216-
```
217-
218-
To fix this, simply name it something else.
219-
220-
Such an error may also occur if you define a type parameter which shadows a
221-
primitive type. An example would be something like:
222-
223-
```
224-
impl<u8> MyTrait for Option<u8> {
225-
// ...
226-
}
227-
```
228-
229-
In such a case, if you meant for `u8` to be a generic type parameter (i.e. any
230-
type can be used in its place), use something like `T` instead:
231-
232-
```
233-
impl<T> MyTrait for Option<T> {
234-
// ...
235-
}
236-
```
237-
238-
On the other hand, if you wished to refer to the specific type `u8`, remove it
239-
from the type parameter list:
240-
241-
```
242-
impl MyTrait for Option<u8> {
243-
// ...
244-
}
210+
name as an existing primitive type.
245211
246212
See the Types section of the reference for more information about the primitive
247213
types:

branches/stable/src/librustc_typeck/collect.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,8 +1918,8 @@ fn get_or_create_type_parameter_def<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>,
19181918
lint::builtin::INVALID_TYPE_PARAM_DEFAULT,
19191919
param.id,
19201920
param.span,
1921-
format!("defaults for type parameters are only allowed in `struct`, \
1922-
`enum`, `type`, or `trait` definitions."));
1921+
format!("defaults for type parameters are only allowed on type definitions, \
1922+
like `struct` or `enum`"));
19231923
}
19241924
}
19251925

branches/stable/src/librustc_typeck/diagnostics.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2269,8 +2269,6 @@ struct MyType<T>(T);
22692269
impl<T> ForeignTrait for MyType<T> { ... } // Ok
22702270
```
22712271
2272-
Please note that a type alias is not sufficient.
2273-
22742272
For another example of an error, suppose there's another trait defined in `foo`
22752273
named `ForeignTrait2` that takes two type parameters. Then this `impl` results
22762274
in the same rule violation:

branches/stable/src/librustdoc/html/layout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ r##"<!DOCTYPE html>
148148
"".to_string()
149149
} else {
150150
format!("<a href='{}{}/index.html'>\
151-
<img src='{}' alt='logo' width='100'></a>",
151+
<img src='{}' alt='' width='100'></a>",
152152
page.root_path, layout.krate,
153153
layout.logo)
154154
},

branches/stable/src/librustdoc/html/static/rustdoc.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ a {
383383
}
384384

385385
.content span.enum, .content a.enum, .block a.current.enum { color: #5e9766; }
386-
.content span.struct, .content a.struct, .block a.current.struct { color: #df3600; }
386+
.content span.struct, .content a.struct, .block a.current.struct { color: #e53700; }
387387
.content a.type { color: #e57300; }
388388
.content a.macro { color: #068000; }
389389
.block a.current.crate { font-weight: 500; }

branches/stable/src/librustdoc/html/static/styles/main.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ a {
106106
}
107107

108108
.docblock a, .stability a {
109-
color: #3873AD;
109+
color: #4e8bca;
110110
}
111111

112112
a.test-arrow {
113113
color: #f5f5f5;
114114
}
115115

116-
.content span.trait, .content a.trait, .block a.current.trait { color: #7c5af3; }
116+
.content span.trait, .content a.trait, .block a.current.trait { color: #8866ff; }
117117

118118
.search-input {
119119
color: #555;

branches/stable/src/libstd/collections/hash/map.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -272,35 +272,6 @@ fn test_resize_policy() {
272272
/// }
273273
/// ```
274274
///
275-
/// `HashMap` also implements an [`Entry API`](#method.entry), which allows
276-
/// for more complex methods of getting, setting, updating and removing keys and
277-
/// their values:
278-
///
279-
/// ```
280-
/// use std::collections::HashMap;
281-
///
282-
/// // type inference lets us omit an explicit type signature (which
283-
/// // would be `HashMap<&str, u8>` in this example).
284-
/// let mut player_stats = HashMap::new();
285-
///
286-
/// fn random_stat_buff() -> u8 {
287-
/// // could actually return some random value here - let's just return
288-
/// // some fixed value for now
289-
/// 42
290-
/// }
291-
///
292-
/// // insert a key only if it doesn't already exist
293-
/// player_stats.entry("health").or_insert(100);
294-
///
295-
/// // insert a key using a function that provides a new value only if it
296-
/// // doesn't already exist
297-
/// player_stats.entry("defence").or_insert_with(random_stat_buff);
298-
///
299-
/// // update a key, guarding against the key possibly not being set
300-
/// let stat = player_stats.entry("attack").or_insert(100);
301-
/// *stat += random_stat_buff();
302-
/// ```
303-
///
304275
/// The easiest way to use `HashMap` with a custom type as key is to derive `Eq` and `Hash`.
305276
/// We must also derive `PartialEq`.
306277
///

branches/stable/src/libstd/ffi/c_str.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,14 +407,16 @@ impl CStr {
407407
/// # fn main() {
408408
/// use std::ffi::CStr;
409409
/// use std::os::raw::c_char;
410+
/// use std::str;
410411
///
411412
/// extern {
412413
/// fn my_string() -> *const c_char;
413414
/// }
414415
///
415416
/// unsafe {
416417
/// let slice = CStr::from_ptr(my_string());
417-
/// println!("string returned: {}", slice.to_str().unwrap());
418+
/// println!("string returned: {}",
419+
/// str::from_utf8(slice.to_bytes()).unwrap());
418420
/// }
419421
/// # }
420422
/// ```

branches/stable/src/libstd/fs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ impl OpenOptions {
414414
/// This option, when true, will indicate that the file should be
415415
/// `write`-able if opened.
416416
///
417-
/// If the file already exists, any write calls on it will overwrite its
417+
/// If a file already exist, any write calls on the file will overwrite its
418418
/// contents, without truncating it.
419419
///
420420
/// # Examples
@@ -487,8 +487,8 @@ impl OpenOptions {
487487
/// This option indicates whether a new file will be created if the file
488488
/// does not yet already exist.
489489
///
490-
/// In order for the file to be created, `write` or `append` access must
491-
/// be used.
490+
/// The file must be opened with write or append access in order to create
491+
/// a new file.
492492
///
493493
/// # Examples
494494
///

branches/stable/src/libstd/sync/semaphore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
of resources is currently unclear",
1414
issue = "27798")]
1515
#![rustc_deprecated(since = "1.7.0",
16-
reason = "easily confused with system sempahores and not \
16+
reason = "easily confused with system semaphores and not \
1717
used enough to pull its weight")]
1818
#![allow(deprecated)]
1919

branches/stable/src/test/auxiliary/issue_30123_aux.rs

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)