Skip to content

Commit 10d69db

Browse files
committed
Auto merge of #27947 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #27903, #27904, #27920, #27921, #27924, #27926, #27934, #27935 - Failed merges:
2 parents 50ebf76 + 17c1d0c commit 10d69db

File tree

7 files changed

+21
-18
lines changed

7 files changed

+21
-18
lines changed

src/doc/nomicon/coercions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Coercion is allowed between the following types:
2222
for all pointer types (including smart pointers like Box and Rc). Unsize is
2323
only implemented automatically, and enables the following transformations:
2424

25-
* `[T, ..n]` => `[T]`
25+
* `[T; n]` => `[T]`
2626
* `T` => `Trait` where `T: Trait`
2727
* `Foo<..., T, ...>` => `Foo<..., U, ...>` where:
2828
* `T: Unsize<U>`

src/doc/nomicon/safe-unsafe-meaning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ unsafe impl UnsafeOrd for MyType {
125125
But it's probably not the implementation you want.
126126

127127
Rust has traditionally avoided making traits unsafe because it makes Unsafe
128-
pervasive, which is not desirable. Send and Sync are unsafe is because thread
128+
pervasive, which is not desirable. The reason Send and Sync are unsafe is because thread
129129
safety is a *fundamental property* that unsafe code cannot possibly hope to defend
130130
against in the same way it would defend against a bad Ord implementation. The
131131
only way to possibly defend against thread-unsafety would be to *not use

src/doc/reference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2073,6 +2073,7 @@ The following configurations must be defined by the implementation:
20732073
* `target_pointer_width = "..."`. Target pointer width in bits. This is set
20742074
to `"32"` for targets with 32-bit pointers, and likewise set to `"64"` for
20752075
64-bit pointers.
2076+
* `test`. Enabled when compiling the test harness (using the `--test` flag).
20762077
* `unix`. See `target_family`.
20772078
* `windows`. See `target_family`.
20782079

src/doc/trpl/concurrency.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,12 +343,14 @@ threads as a simple isolation mechanism:
343343
```rust
344344
use std::thread;
345345

346-
let result = thread::spawn(move || {
346+
let handle = thread::spawn(move || {
347347
panic!("oops!");
348-
}).join();
348+
});
349+
350+
let result = handle.join();
349351

350352
assert!(result.is_err());
351353
```
352354

353-
Our `Thread` gives us a `Result` back, which allows us to check if the thread
355+
`Thread.join()` gives us a `Result` back, which allows us to check if the thread
354356
has panicked or not.

src/doc/trpl/documentation.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ hello.rs:4 }
7373
```
7474

7575
This [unfortunate error](https://github.com/rust-lang/rust/issues/22547) is
76-
correct: documentation comments apply to the thing after them, and there's no
77-
thing after that last comment.
76+
correct: documentation comments apply to the thing after them, and there's
77+
nothing after that last comment.
7878

7979
[rc-new]: https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.new
8080

@@ -196,10 +196,10 @@ This will highlight according to whatever language you're showing off.
196196
If you're just showing plain text, choose `text`.
197197

198198
It's important to choose the correct annotation here, because `rustdoc` uses it
199-
in an interesting way: It can be used to actually test your examples, so that
200-
they don't get out of date. If you have some C code but `rustdoc` thinks it's
201-
Rust because you left off the annotation, `rustdoc` will complain when trying to
202-
generate the documentation.
199+
in an interesting way: It can be used to actually test your examples in a
200+
library crate, so that they don't get out of date. If you have some C code but
201+
`rustdoc` thinks it's Rust because you left off the annotation, `rustdoc` will
202+
complain when trying to generate the documentation.
203203

204204
## Documentation as tests
205205

@@ -377,8 +377,8 @@ $ rustdoc --test path/to/my/crate/root.rs
377377
$ cargo test
378378
```
379379

380-
That's right, `cargo test` tests embedded documentation too. However,
381-
`cargo test` will not test binary crates, only library ones. This is
380+
That's right, `cargo test` tests embedded documentation too. **However,
381+
`cargo test` will not test binary crates, only library ones.** This is
382382
due to the way `rustdoc` works: it links against the library to be tested,
383383
but with a binary, there’s nothing to link to.
384384

src/doc/trpl/testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,8 @@ Let's finally check out that third section: documentation tests.
355355
Nothing is better than documentation with examples. Nothing is worse than
356356
examples that don't actually work, because the code has changed since the
357357
documentation has been written. To this end, Rust supports automatically
358-
running examples in your documentation. Here's a fleshed-out `src/lib.rs`
359-
with examples:
358+
running examples in your documentation (**note:** this only works in library
359+
crates, not binary crates). Here's a fleshed-out `src/lib.rs` with examples:
360360

361361
```rust,ignore
362362
//! The `adder` crate provides functions that add numbers to other numbers.

src/libcore/intrinsics.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,11 @@ extern "rust-intrinsic" {
247247
/// ```
248248
/// use std::mem;
249249
///
250-
/// let v: &[u8] = unsafe { mem::transmute("L") };
251-
/// assert!(v == [76]);
250+
/// let array: &[u8] = unsafe { mem::transmute("Rust") };
251+
/// assert_eq!(array, [82, 117, 115, 116]);
252252
/// ```
253253
#[stable(feature = "rust1", since = "1.0.0")]
254-
pub fn transmute<T,U>(e: T) -> U;
254+
pub fn transmute<T, U>(e: T) -> U;
255255

256256
/// Gives the address for the return value of the enclosing function.
257257
///

0 commit comments

Comments
 (0)