Skip to content

Commit cf1f038

Browse files
committed
Reorder description for snippets in rustdoc documentation
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.
1 parent fd18d25 commit cf1f038

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/doc/rustdoc/src/documentation-tests.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ not actually pass as a test.
268268
# fn foo() {}
269269
```
270270

271-
`compile_fail` tells `rustdoc` that the compilation should fail. If it
272-
compiles, then the test will fail. However please note that code failing
273-
with the current Rust release may work in a future release, as new features
274-
are added.
271+
The `no_run` attribute will compile your code, but not run it. This is
272+
important for examples such as "Here's how to retrieve a web page,"
273+
which you would want to ensure compiles, but might be run in a test
274+
environment that has no network access.
275275

276276
```text
277277
/// ```compile_fail
@@ -280,7 +280,7 @@ are added.
280280
/// ```
281281
```
282282

283-
The `no_run` attribute will compile your code, but not run it. This is
284-
important for examples such as "Here's how to retrieve a web page,"
285-
which you would want to ensure compiles, but might be run in a test
286-
environment that has no network access.
283+
`compile_fail` tells `rustdoc` that the compilation should fail. If it
284+
compiles, then the test will fail. However please note that code failing
285+
with the current Rust release may work in a future release, as new features
286+
are added.

0 commit comments

Comments
 (0)