Skip to content

Rollup of 8 pull requests #27947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Aug 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/doc/nomicon/coercions.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Coercion is allowed between the following types:
for all pointer types (including smart pointers like Box and Rc). Unsize is
only implemented automatically, and enables the following transformations:

* `[T, ..n]` => `[T]`
* `[T; n]` => `[T]`
* `T` => `Trait` where `T: Trait`
* `Foo<..., T, ...>` => `Foo<..., U, ...>` where:
* `T: Unsize<U>`
Expand Down
2 changes: 1 addition & 1 deletion src/doc/nomicon/safe-unsafe-meaning.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ unsafe impl UnsafeOrd for MyType {
But it's probably not the implementation you want.

Rust has traditionally avoided making traits unsafe because it makes Unsafe
pervasive, which is not desirable. Send and Sync are unsafe is because thread
pervasive, which is not desirable. The reason Send and Sync are unsafe is because thread
safety is a *fundamental property* that unsafe code cannot possibly hope to defend
against in the same way it would defend against a bad Ord implementation. The
only way to possibly defend against thread-unsafety would be to *not use
Expand Down
1 change: 1 addition & 0 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2073,6 +2073,7 @@ The following configurations must be defined by the implementation:
* `target_pointer_width = "..."`. Target pointer width in bits. This is set
to `"32"` for targets with 32-bit pointers, and likewise set to `"64"` for
64-bit pointers.
* `test`. Enabled when compiling the test harness (using the `--test` flag).
* `unix`. See `target_family`.
* `windows`. See `target_family`.

Expand Down
8 changes: 5 additions & 3 deletions src/doc/trpl/concurrency.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,14 @@ threads as a simple isolation mechanism:
```rust
use std::thread;

let result = thread::spawn(move || {
let handle = thread::spawn(move || {
panic!("oops!");
}).join();
});

let result = handle.join();

assert!(result.is_err());
```

Our `Thread` gives us a `Result` back, which allows us to check if the thread
`Thread.join()` gives us a `Result` back, which allows us to check if the thread
has panicked or not.
16 changes: 8 additions & 8 deletions src/doc/trpl/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ hello.rs:4 }
```

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

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

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

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

## Documentation as tests

Expand Down Expand Up @@ -377,8 +377,8 @@ $ rustdoc --test path/to/my/crate/root.rs
$ cargo test
```

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

Expand Down
4 changes: 2 additions & 2 deletions src/doc/trpl/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,8 @@ Let's finally check out that third section: documentation tests.
Nothing is better than documentation with examples. Nothing is worse than
examples that don't actually work, because the code has changed since the
documentation has been written. To this end, Rust supports automatically
running examples in your documentation. Here's a fleshed-out `src/lib.rs`
with examples:
running examples in your documentation (**note:** this only works in library
crates, not binary crates). Here's a fleshed-out `src/lib.rs` with examples:

```rust,ignore
//! The `adder` crate provides functions that add numbers to other numbers.
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,11 @@ extern "rust-intrinsic" {
/// ```
/// use std::mem;
///
/// let v: &[u8] = unsafe { mem::transmute("L") };
/// assert!(v == [76]);
/// let array: &[u8] = unsafe { mem::transmute("Rust") };
/// assert_eq!(array, [82, 117, 115, 116]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn transmute<T,U>(e: T) -> U;
pub fn transmute<T, U>(e: T) -> U;

/// Gives the address for the return value of the enclosing function.
///
Expand Down