Skip to content

Commit

Permalink
Reorder description for snippets in rustdoc documentation
Browse files Browse the repository at this point in the history
The example code snippets for the `no_run` and `compile_fail` attributes
in the rustdoc documentation were followed by the description for the
wrong attribute.  This patch reorders the descriptions to match the code
snippets.
  • Loading branch information
robinkrahl committed May 18, 2018
1 parent fd18d25 commit cf1f038
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/doc/rustdoc/src/documentation-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ not actually pass as a test.
# fn foo() {}
```
`compile_fail` tells `rustdoc` that the compilation should fail. If it
compiles, then the test will fail. However please note that code failing
with the current Rust release may work in a future release, as new features
are added.
The `no_run` attribute will compile your code, but not run it. This is
important for examples such as "Here's how to retrieve a web page,"
which you would want to ensure compiles, but might be run in a test
environment that has no network access.
```text
/// ```compile_fail
Expand All @@ -280,7 +280,7 @@ are added.
/// ```
```
The `no_run` attribute will compile your code, but not run it. This is
important for examples such as "Here's how to retrieve a web page,"
which you would want to ensure compiles, but might be run in a test
environment that has no network access.
`compile_fail` tells `rustdoc` that the compilation should fail. If it
compiles, then the test will fail. However please note that code failing
with the current Rust release may work in a future release, as new features
are added.

0 comments on commit cf1f038

Please sign in to comment.