Skip to content

Commit 0d6bee1

Browse files
committed
---
yaml --- r: 274213 b: refs/heads/stable c: 6a6e9a9 h: refs/heads/master i: 274211: 0f92959
1 parent 73ca356 commit 0d6bee1

File tree

23 files changed

+50
-196
lines changed

23 files changed

+50
-196
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: b0b1df84254fb6b6fc9eb11cceea8441c6cf596d
32+
refs/heads/stable: 6a6e9a987a0c11368f921057fdb52f3719aa555f
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/COPYRIGHT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ terms.
77
Longer version:
88

99
The Rust Project is copyright 2016, The Rust Project
10-
Developers.
10+
Developers (given in the file AUTHORS.txt).
1111

1212
Licensed under the Apache License, Version 2.0
1313
<LICENSE-APACHE or

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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,7 @@ 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`
911912
returned by `parse()` is an `enum` like `Ordering`, but in this case, each
912913
variant has some data associated with it: `Ok` is a success, and `Err` is a
913914
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/primitive-types.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,6 @@ copying. For example, you might want to reference only one line of a file read
164164
into memory. By nature, a slice is not created directly, but from an existing
165165
variable binding. Slices have a defined length, can be mutable or immutable.
166166

167-
Internally, slices are represented as a pointer to the beginning of the data
168-
and a length.
169-
170167
## Slicing syntax
171168

172169
You can use a combo of `&` and `[]` to create a slice from various things. The

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/format.rs

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -456,44 +456,23 @@ impl fmt::Display for clean::Type {
456456
decl.decl)
457457
}
458458
clean::Tuple(ref typs) => {
459-
match &**typs {
460-
[] => primitive_link(f, clean::PrimitiveTuple, "()"),
461-
[ref one] => {
462-
try!(primitive_link(f, clean::PrimitiveTuple, "("));
463-
try!(write!(f, "{}", one));
464-
primitive_link(f, clean::PrimitiveTuple, ")")
465-
}
466-
many => {
467-
try!(primitive_link(f, clean::PrimitiveTuple, "("));
468-
try!(write!(f, "{}", CommaSep(&many)));
469-
primitive_link(f, clean::PrimitiveTuple, ")")
470-
}
471-
}
459+
primitive_link(f, clean::PrimitiveTuple,
460+
&*match &**typs {
461+
[ref one] => format!("({},)", one),
462+
many => format!("({})", CommaSep(&many)),
463+
})
472464
}
473465
clean::Vector(ref t) => {
474-
try!(primitive_link(f, clean::Slice, &format!("[")));
475-
try!(write!(f, "{}", t));
476-
primitive_link(f, clean::Slice, &format!("]"))
466+
primitive_link(f, clean::Slice, &format!("[{}]", **t))
477467
}
478468
clean::FixedVector(ref t, ref s) => {
479-
try!(primitive_link(f, clean::PrimitiveType::Array, "["));
480-
try!(write!(f, "{}", t));
481469
primitive_link(f, clean::PrimitiveType::Array,
482-
&format!("; {}]", *s))
470+
&format!("[{}; {}]", **t, *s))
483471
}
484472
clean::Bottom => f.write_str("!"),
485473
clean::RawPointer(m, ref t) => {
486-
match **t {
487-
clean::Generic(_) | clean::ResolvedPath {is_generic: true, ..} => {
488-
primitive_link(f, clean::PrimitiveType::PrimitiveRawPointer,
489-
&format!("*{}{}", RawMutableSpace(m), t))
490-
}
491-
_ => {
492-
try!(primitive_link(f, clean::PrimitiveType::PrimitiveRawPointer,
493-
&format!("*{}", RawMutableSpace(m))));
494-
write!(f, "{}", t)
495-
}
496-
}
474+
primitive_link(f, clean::PrimitiveType::PrimitiveRawPointer,
475+
&format!("*{}{}", RawMutableSpace(m), **t))
497476
}
498477
clean::BorrowedRef{ lifetime: ref l, mutability, type_: ref ty} => {
499478
let lt = match *l {

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
/// ```

0 commit comments

Comments
 (0)