Skip to content

Commit e9c36cb

Browse files
committed
---
yaml --- r: 193342 b: refs/heads/beta c: c195783 h: refs/heads/master v: v3
1 parent fbf39a9 commit e9c36cb

File tree

127 files changed

+1580
-2543
lines changed

Some content is hidden

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

127 files changed

+1580
-2543
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 3b30b74692cfee533b45e0380591d237975ec215
34+
refs/heads/beta: c195783c05d253c8e32fb781cce1ae978f8bd6bd
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

branches/beta/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

branches/beta/src/doc/reference.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2495,6 +2495,12 @@ The currently implemented features of the reference compiler are:
24952495

24962496
* `staged_api` - Allows usage of stability markers and `#![staged_api]` in a crate
24972497

2498+
* `static_assert` - The `#[static_assert]` functionality is experimental and
2499+
unstable. The attribute can be attached to a `static` of
2500+
type `bool` and the compiler will error if the `bool` is
2501+
`false` at compile time. This version of this functionality
2502+
is unintuitive and suboptimal.
2503+
24982504
* `start` - Allows use of the `#[start]` attribute, which changes the entry point
24992505
into a Rust program. This capabiilty, especially the signature for the
25002506
annotated function, is subject to change.

branches/beta/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

branches/beta/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);

0 commit comments

Comments
 (0)