Skip to content

Commit 31e3cb7

Browse files
committed
Auto merge of #25111 - Manishearth:rollup, r=Manishearth
r? @Manishearth
2 parents 0be117e + 135502e commit 31e3cb7

File tree

22 files changed

+81
-212
lines changed

22 files changed

+81
-212
lines changed

src/doc/complement-lang-faq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ This does mean that indexed access to a Unicode codepoint inside a `str` value i
109109
* Most "character oriented" operations on text only work under very restricted language assumptions sets such as "ASCII-range codepoints only". Outside ASCII-range, you tend to have to use a complex (non-constant-time) algorithm for determining linguistic-unit (glyph, word, paragraph) boundaries anyways. We recommend using an "honest" linguistically-aware, Unicode-approved algorithm.
110110
* The `char` type is UCS4. If you honestly need to do a codepoint-at-a-time algorithm, it's trivial to write a `type wstr = [char]`, and unpack a `str` into it in a single pass, then work with the `wstr`. In other words: the fact that the language is not "decoding to UCS4 by default" shouldn't stop you from decoding (or re-encoding any other way) if you need to work with that encoding.
111111

112-
## Why are strings, vectors etc. built-in types rather than (say) special kinds of trait/impl?
112+
## Why are `str`s, slices, arrays etc. built-in types rather than (say) special kinds of trait/impl?
113113

114114
In each case there is one or more operator, literal constructor, overloaded use or integration with a built-in control structure that makes us think it would be awkward to phrase the type in terms of more-general type constructors. Same as, say, with numbers! But this is partly an aesthetic call, and we'd be willing to look at a worked-out proposal for eliminating or rephrasing these special cases.
115115

src/doc/trpl/error-handling.md

+2-2
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));

src/doc/trpl/hello-cargo.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ projects. Cargo is currently in a pre-1.0 state, and so it is still a work in
55
progress. However, it is already good enough to use for many Rust projects, and
66
so it is assumed that Rust projects will use Cargo from the beginning.
77

8-
[cratesio]: https://doc.crates.io
8+
[cratesio]: http://doc.crates.io
99

1010
Cargo manages three things: building your code, downloading the dependencies
1111
your code needs, and building those dependencies. At first, your

src/doc/trpl/installing-rust.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ or a Mac, all you need to do is this (note that you don't need to type in the
66
`$`s, they just indicate the start of each command):
77

88
```bash
9-
$ curl -sf -L https://static.rust-lang.org/rustup.sh | sudo sh
9+
$ curl -sf -L https://static.rust-lang.org/rustup.sh | sh
1010
```
1111

1212
If you're concerned about the [potential insecurity][insecurity] of using `curl
13-
| sudo sh`, please keep reading and see our disclaimer below. And feel free to
13+
| sh`, please keep reading and see our disclaimer below. And feel free to
1414
use a two-step version of the installation and examine our installation script:
1515

1616
```bash
1717
$ curl -f -L https://static.rust-lang.org/rustup.sh -O
18-
$ sudo sh rustup.sh
18+
$ sh rustup.sh
1919
```
2020

2121
[insecurity]: http://curlpipesh.tumblr.com
@@ -40,13 +40,11 @@ If you used the Windows installer, just re-run the `.msi` and it will give you
4040
an uninstall option.
4141

4242
Some people, and somewhat rightfully so, get very upset when we tell you to
43-
`curl | sudo sh`. Basically, when you do this, you are trusting that the good
43+
`curl | sh`. Basically, when you do this, you are trusting that the good
4444
people who maintain Rust aren't going to hack your computer and do bad things.
4545
That's a good instinct! If you're one of those people, please check out the
4646
documentation on [building Rust from Source][from source], or [the official
47-
binary downloads][install page]. And we promise that this method will not be
48-
the way to install Rust forever: it's just the easiest way to keep people
49-
updated while Rust is in its alpha state.
47+
binary downloads][install page].
5048

5149
[from source]: https://github.com/rust-lang/rust#building-from-source
5250
[install page]: http://www.rust-lang.org/install.html

src/doc/trpl/nightly-rust.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ process, see ‘[Stability as a deliverable][stability]’.
99
To install nightly Rust, you can use `rustup.sh`:
1010

1111
```bash
12-
$ curl -s https://static.rust-lang.org/rustup.sh | sudo sh -s -- --channel=nightly
12+
$ curl -s https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly
1313
```
1414

1515
If you're concerned about the [potential insecurity][insecurity] of using `curl
16-
| sudo sh`, please keep reading and see our disclaimer below. And feel free to
16+
| sh`, please keep reading and see our disclaimer below. And feel free to
1717
use a two-step version of the installation and examine our installation script:
1818

1919
```bash
2020
$ curl -f -L https://static.rust-lang.org/rustup.sh -O
21-
$ sudo sh rustup.sh --channel=nightly
21+
$ sh rustup.sh --channel=nightly
2222
```
2323

2424
[insecurity]: http://curlpipesh.tumblr.com
@@ -43,13 +43,11 @@ If you used the Windows installer, just re-run the `.msi` and it will give you
4343
an uninstall option.
4444

4545
Some people, and somewhat rightfully so, get very upset when we tell you to
46-
`curl | sudo sh`. Basically, when you do this, you are trusting that the good
46+
`curl | sh`. Basically, when you do this, you are trusting that the good
4747
people who maintain Rust aren't going to hack your computer and do bad things.
4848
That's a good instinct! If you're one of those people, please check out the
4949
documentation on [building Rust from Source][from source], or [the official
50-
binary downloads][install page]. And we promise that this method will not be
51-
the way to install Rust forever: it's just the easiest way to keep people
52-
updated while Rust is in its alpha state.
50+
binary downloads][install page].
5351

5452
[from source]: https://github.com/rust-lang/rust#building-from-source
5553
[install page]: http://www.rust-lang.org/install.html

src/etc/extract_grammar.py

-156
This file was deleted.

src/libcollections/str.rs

+2-2
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
///

src/libcollections/string.rs

+1-1
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
}

src/libcollections/vec.rs

+12-4
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

src/libcore/option.rs

+1-1
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> {

src/libcore/str/mod.rs

+1-1
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);

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

+1-1
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
///

src/librustc/middle/ty.rs

+1-1
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

0 commit comments

Comments
 (0)