Skip to content

Commit a5987af

Browse files
committed
---
yaml --- r: 210291 b: refs/heads/try c: aff0782 h: refs/heads/master i: 210289: e1a8fc7 210287: bf916fe v: v3
1 parent 75c684d commit a5987af

Some content is hidden

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

43 files changed

+307
-239
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: 2de6515de8cf3298a9f17f0c520c491f56b017b7
5+
refs/heads/try: aff0782b23a40b16719f3e045e329f8141abf82e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/doc/trpl/error-handling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ struct Info {
252252
}
253253

254254
fn write_info(info: &Info) -> io::Result<()> {
255-
let mut file = File::open("my_best_friends.txt").unwrap();
255+
let mut file = File::create("my_best_friends.txt").unwrap();
256256

257257
if let Err(e) = writeln!(&mut file, "name: {}", info.name) {
258258
return Err(e)
@@ -282,7 +282,7 @@ struct Info {
282282
}
283283

284284
fn write_info(info: &Info) -> io::Result<()> {
285-
let mut file = try!(File::open("my_best_friends.txt"));
285+
let mut file = try!(File::create("my_best_friends.txt"));
286286

287287
try!(writeln!(&mut file, "name: {}", info.name));
288288
try!(writeln!(&mut file, "age: {}", info.age));

branches/try/src/etc/extract_grammar.py

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

branches/try/src/libcollections/str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ impl str {
713713
/// is skipped if empty.
714714
///
715715
/// This method can be used for string data that is _terminated_,
716-
/// rather than _seperated_ by a pattern.
716+
/// rather than _separated_ by a pattern.
717717
///
718718
/// # Iterator behavior
719719
///
@@ -760,7 +760,7 @@ impl str {
760760
/// skipped if empty.
761761
///
762762
/// This method can be used for string data that is _terminated_,
763-
/// rather than _seperated_ by a pattern.
763+
/// rather than _separated_ by a pattern.
764764
///
765765
/// # Iterator behavior
766766
///

branches/try/src/libcollections/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ impl FromUtf8Error {
757757
#[stable(feature = "rust1", since = "1.0.0")]
758758
pub fn into_bytes(self) -> Vec<u8> { self.bytes }
759759

760-
/// Accesss the underlying UTF8-error that was the cause of this error.
760+
/// Access the underlying UTF8-error that was the cause of this error.
761761
#[stable(feature = "rust1", since = "1.0.0")]
762762
pub fn utf8_error(&self) -> Utf8Error { self.error }
763763
}

branches/try/src/libcollections/vec.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,43 @@
1515
//!
1616
//! # Examples
1717
//!
18-
//! Explicitly creating a `Vec<T>` with `new()`:
18+
//! You can explicitly create a `Vec<T>` with `new()`:
1919
//!
2020
//! ```
2121
//! let xs: Vec<i32> = Vec::new();
2222
//! ```
2323
//!
24-
//! Using the `vec!` macro:
24+
//! ...or by using the `vec!` macro:
2525
//!
2626
//! ```
2727
//! let ys: Vec<i32> = vec![];
2828
//!
2929
//! let zs = vec![1i32, 2, 3, 4, 5];
3030
//! ```
3131
//!
32-
//! Push:
32+
//! You can `push` values onto the end of a vector (which will grow the vector as needed):
3333
//!
3434
//! ```
3535
//! let mut xs = vec![1i32, 2];
3636
//!
3737
//! xs.push(3);
3838
//! ```
3939
//!
40-
//! And pop:
40+
//! Popping values works in much the same way:
4141
//!
4242
//! ```
4343
//! let mut xs = vec![1i32, 2];
4444
//!
4545
//! let two = xs.pop();
4646
//! ```
47+
//!
48+
//! Vectors also support indexing (through the `Index` and `IndexMut` traits):
49+
//!
50+
//! ```
51+
//! let mut xs = vec![1i32, 2, 3];
52+
//! let three = xs[2];
53+
//! xs[1] = xs[1] + 5;
54+
//! ```
4755
4856
#![stable(feature = "rust1", since = "1.0.0")]
4957

branches/try/src/libcore/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ use slice;
161161
// `Iterator` is an enumeration with one type parameter and two variants,
162162
// which basically means it must be `Option`.
163163

164-
/// The `Option` type. See [the module level documentation](../index.html) for more.
164+
/// The `Option` type. See [the module level documentation](index.html) for more.
165165
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
166166
#[stable(feature = "rust1", since = "1.0.0")]
167167
pub enum Option<T> {

branches/try/src/libcore/str/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ macro_rules! derive_pattern_clone {
421421
/// wrapping an private internal one that makes use of the `Pattern` API.
422422
///
423423
/// For all patterns `P: Pattern<'a>` the following items will be
424-
/// generated (generics ommitted):
424+
/// generated (generics omitted):
425425
///
426426
/// struct $forward_iterator($internal_iterator);
427427
/// struct $reverse_iterator($internal_iterator);

branches/try/src/librustc/middle/infer/higher_ranked/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ impl<'a,'tcx> InferCtxtExt for InferCtxt<'a,'tcx> {
461461

462462
/// Constructs and returns a substitution that, for a given type
463463
/// scheme parameterized by `generics`, will replace every generic
464-
/// parmeter in the type with a skolemized type/region (which one can
464+
/// parameter in the type with a skolemized type/region (which one can
465465
/// think of as a "fresh constant", except at the type/region level of
466466
/// reasoning).
467467
///

branches/try/src/librustc/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1908,7 +1908,7 @@ pub enum Predicate<'tcx> {
19081908
}
19091909

19101910
impl<'tcx> Predicate<'tcx> {
1911-
/// Performs a substituion suitable for going from a
1911+
/// Performs a substitution suitable for going from a
19121912
/// poly-trait-ref to supertraits that must hold if that
19131913
/// poly-trait-ref holds. This is slightly different from a normal
19141914
/// substitution in terms of what happens with bound regions. See

branches/try/src/librustc_trans/back/link.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ fn add_local_native_libraries(cmd: &mut Command, sess: &Session) {
10781078
sess.target_filesearch(PathKind::All).for_each_lib_search_path(|path, k| {
10791079
match k {
10801080
PathKind::Framework => { cmd.arg("-F").arg(path); }
1081-
_ => { cmd.arg("-L").arg(path); }
1081+
_ => { cmd.arg("-L").arg(&fix_windows_verbatim_for_gcc(path)); }
10821082
}
10831083
FileDoesntMatch
10841084
});

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,9 @@ fn test_resize_policy() {
212212
/// overridden with one of the constructors.
213213
///
214214
/// It is required that the keys implement the `Eq` and `Hash` traits, although
215-
/// this can frequently be achieved by using `#[derive(Eq, Hash)]`. If you
216-
/// implement these yourself, it is important that the following property holds:
215+
/// this can frequently be achieved by using `#[derive(PartialEq, Eq, Hash)]`.
216+
/// If you implement these yourself, it is important that the following
217+
/// property holds:
217218
///
218219
/// ```text
219220
/// k1 == k2 -> hash(k1) == hash(k2)
@@ -250,26 +251,26 @@ fn test_resize_policy() {
250251
/// book_reviews.insert("The Adventures of Sherlock Holmes", "Eye lyked it alot.");
251252
///
252253
/// // check for a specific one.
253-
/// if !book_reviews.contains_key(&("Les Misérables")) {
254+
/// if !book_reviews.contains_key("Les Misérables") {
254255
/// println!("We've got {} reviews, but Les Misérables ain't one.",
255256
/// book_reviews.len());
256257
/// }
257258
///
258259
/// // oops, this review has a lot of spelling mistakes, let's delete it.
259-
/// book_reviews.remove(&("The Adventures of Sherlock Holmes"));
260+
/// book_reviews.remove("The Adventures of Sherlock Holmes");
260261
///
261262
/// // look up the values associated with some keys.
262263
/// let to_find = ["Pride and Prejudice", "Alice's Adventure in Wonderland"];
263-
/// for book in to_find.iter() {
264+
/// for book in &to_find {
264265
/// match book_reviews.get(book) {
265-
/// Some(review) => println!("{}: {}", *book, *review),
266-
/// None => println!("{} is unreviewed.", *book)
266+
/// Some(review) => println!("{}: {}", book, review),
267+
/// None => println!("{} is unreviewed.", book)
267268
/// }
268269
/// }
269270
///
270271
/// // iterate over everything.
271-
/// for (book, review) in book_reviews.iter() {
272-
/// println!("{}: \"{}\"", *book, *review);
272+
/// for (book, review) in &book_reviews {
273+
/// println!("{}: \"{}\"", book, review);
273274
/// }
274275
/// ```
275276
///
@@ -300,7 +301,7 @@ fn test_resize_policy() {
300301
/// vikings.insert(Viking::new("Harald", "Iceland"), 12);
301302
///
302303
/// // Use derived implementation to print the status of the vikings.
303-
/// for (viking, health) in vikings.iter() {
304+
/// for (viking, health) in &vikings {
304305
/// println!("{:?} has {} hp", viking, health);
305306
/// }
306307
/// ```

0 commit comments

Comments
 (0)