Skip to content

Commit 4925a88

Browse files
committed
---
yaml --- r: 185645 b: refs/heads/master c: 31ad998 h: refs/heads/master i: 185643: 32c3a26 v: v3
1 parent d1126e2 commit 4925a88

File tree

26 files changed

+155
-774
lines changed

26 files changed

+155
-774
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: 8567f290b840bbdf1149a23faa4ac4c47ab62fb4
2+
refs/heads/master: 31ad998bfd974a5488665099fe6b5962583fa958
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 3a96d6a9818fe2affc98a187fb1065120458cee9
55
refs/heads/try: ccf8fedf1cffcb8f6f3581d53d220039e192fe77

trunk/src/doc/intro.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,10 +510,10 @@ numbers[1] is 3
510510
numbers[0] is 2
511511
```
512512
513-
Each time, we can get a slightly different output because the threads are not
514-
guaranteed to run in any set order. If you get the same order every time it is
515-
because each of these threads are very small and complete too fast for their
516-
indeterminate behavior to surface.
513+
Each time, we can get a slithtly different output because the threads
514+
are not quaranteed to run in any set order. If you get the same order
515+
every time it is because each of these threads are very small and
516+
complete too fast for their indeterminate behavior to surface.
517517
518518
The important part here is that the Rust compiler was able to use ownership to
519519
give us assurance _at compile time_ that we weren't doing something incorrect

trunk/src/doc/trpl/guessing-game.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -422,11 +422,11 @@ In this case, we say `x` is a `u32` explicitly, so Rust is able to properly
422422
tell `random()` what to generate. In a similar fashion, both of these work:
423423
424424
```{rust,ignore}
425-
let input_num_option = "5".parse::<u32>().ok(); // input_num: Option<u32>
426-
let input_num_result: Result<u32, _> = "5".parse(); // input_num: Result<u32, <u32 as FromStr>::Err>
425+
let input_num = "5".parse::<u32>(); // input_num: Option<u32>
426+
let input_num: Result<u32, _> = "5".parse(); // input_num: Result<u32, <u32 as FromStr>::Err>
427427
```
428428
429-
Above, we're converting the `Result` returned by `parse` to an `Option` by using
429+
Here we're converting the `Result` returned by `parse` to an `Option` by using
430430
the `ok` method as well. Anyway, with us now converting our input to a number,
431431
our code looks like this:
432432
@@ -470,14 +470,14 @@ Let's try it out!
470470
```bash
471471
$ cargo build
472472
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
473-
src/main.rs:21:15: 21:24 error: mismatched types: expected `u32`, found `core::result::Result<u32, core::num::ParseIntError>` (expected u32, found enum `core::result::Result`) [E0308]
474-
src/main.rs:21 match cmp(input_num, secret_number) {
473+
src/main.rs:22:15: 22:24 error: mismatched types: expected `u32` but found `core::option::Option<u32>` (expected u32 but found enum core::option::Option)
474+
src/main.rs:22 match cmp(input_num, secret_number) {
475475
^~~~~~~~~
476476
error: aborting due to previous error
477477
```
478478
479-
Oh yeah! Our `input_num` has the type `Result<u32, <some error>>`, rather than `u32`. We
480-
need to unwrap the Result. If you remember from before, `match` is a great way
479+
Oh yeah! Our `input_num` has the type `Option<u32>`, rather than `u32`. We
480+
need to unwrap the Option. If you remember from before, `match` is a great way
481481
to do that. Try this code:
482482
483483
```{rust,no_run}
@@ -500,7 +500,7 @@ fn main() {
500500
let input_num: Result<u32, _> = input.parse();
501501

502502
let num = match input_num {
503-
Ok(n) => n,
503+
Ok(num) => num,
504504
Err(_) => {
505505
println!("Please input a number!");
506506
return;
@@ -524,7 +524,7 @@ fn cmp(a: u32, b: u32) -> Ordering {
524524
}
525525
```
526526
527-
We use a `match` to either give us the `u32` inside of the `Result`, or else
527+
We use a `match` to either give us the `u32` inside of the `Option`, or else
528528
print an error message and return. Let's give this a shot:
529529
530530
```bash

trunk/src/liballoc/arc.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,10 @@ impl<T> Arc<T> {
201201
impl<T> Arc<T> {
202202
#[inline]
203203
fn inner(&self) -> &ArcInner<T> {
204-
// This unsafety is ok because while this arc is alive we're guaranteed
205-
// that the inner pointer is valid. Furthermore, we know that the
206-
// `ArcInner` structure itself is `Sync` because the inner data is
207-
// `Sync` as well, so we're ok loaning out an immutable pointer to these
208-
// contents.
204+
// This unsafety is ok because while this arc is alive we're guaranteed that the inner
205+
// pointer is valid. Furthermore, we know that the `ArcInner` structure itself is `Sync`
206+
// because the inner data is `Sync` as well, so we're ok loaning out an immutable pointer
207+
// to these contents.
209208
unsafe { &**self._ptr }
210209
}
211210
}
@@ -237,15 +236,13 @@ impl<T> Clone for Arc<T> {
237236
/// ```
238237
#[inline]
239238
fn clone(&self) -> Arc<T> {
240-
// Using a relaxed ordering is alright here, as knowledge of the
241-
// original reference prevents other threads from erroneously deleting
242-
// the object.
239+
// Using a relaxed ordering is alright here, as knowledge of the original reference
240+
// prevents other threads from erroneously deleting the object.
243241
//
244-
// As explained in the [Boost documentation][1], Increasing the
245-
// reference counter can always be done with memory_order_relaxed: New
246-
// references to an object can only be formed from an existing
247-
// reference, and passing an existing reference from one thread to
248-
// another must already provide any required synchronization.
242+
// As explained in the [Boost documentation][1], Increasing the reference counter can
243+
// always be done with memory_order_relaxed: New references to an object can only be formed
244+
// from an existing reference, and passing an existing reference from one thread to another
245+
// must already provide any required synchronization.
249246
//
250247
// [1]: (www.boost.org/doc/libs/1_55_0/doc/html/atomic/usage_examples.html)
251248
self.inner().strong.fetch_add(1, Relaxed);

trunk/src/libcollections/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@
364364
//! * `o` - precedes the argument with a "0o"
365365
//! * '0' - This is used to indicate for integer formats that the padding should
366366
//! both be done with a `0` character as well as be sign-aware. A format
367-
//! like `{:08}` would yield `00000001` for the integer `1`, while the
367+
//! like `{:08d}` would yield `00000001` for the integer `1`, while the
368368
//! same format would yield `-0000001` for the integer `-1`. Notice that
369369
//! the negative version has one fewer zero than the positive version.
370370
//!

trunk/src/libstd/io/lazy.rs

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

trunk/src/libstd/io/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,13 @@ pub use self::buffered::IntoInnerError;
3939
pub use self::cursor::Cursor;
4040
pub use self::error::{Result, Error, ErrorKind};
4141
pub use self::util::{copy, sink, Sink, empty, Empty, repeat, Repeat};
42-
pub use self::stdio::{stdin, stdout, stderr, Stdin, Stdout, Stderr};
43-
pub use self::stdio::{StdoutLock, StderrLock, StdinLock};
44-
45-
#[macro_use] mod lazy;
4642

4743
pub mod prelude;
4844
mod buffered;
4945
mod cursor;
5046
mod error;
5147
mod impls;
5248
mod util;
53-
mod stdio;
5449

5550
const DEFAULT_BUF_SIZE: usize = 64 * 1024;
5651

0 commit comments

Comments
 (0)