Skip to content

Commit 84e694b

Browse files
committed
Apply some light edits to the examples chapter
1 parent e71e896 commit 84e694b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

reference-dev-guide/src/examples.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,24 @@ See the [mdBook supported languages] for a list of supported languages.
1212

1313
## rustdoc attributes
1414

15-
Rust examples are [tested via rustdoc], and should include the appropriate annotations:
15+
Rust examples are [tested via rustdoc] and should include the appropriate annotations:
1616

17-
- `edition2015`, `edition2018`, etc. --- If it is edition-specific (see `book.toml` for the default).
18-
- `no_run` --- The example should compile successfully, but should not be executed.
19-
- `should_panic` --- The example should compile and run, but produce a panic.
17+
- `edition2015`, `edition2018`, etc. --- Use if it is edition-specific (see `book.toml` for the default).
18+
- `no_run` --- The example should compile successfully but should not be executed.
19+
- `should_panic` --- The example should compile and run but produce a panic.
2020
- `compile_fail` --- The example is expected to fail to compile.
21-
- `ignore` --- The example shouldn't be built or tested. This should be avoided if possible. Usually this is only necessary when the testing framework does not support it (such as external crates or modules, or a proc-macro), or it contains pseudo-code which is not valid Rust. An HTML comment such as `<!-- ignore: requires extern crate -->` should be placed before the example to explain why it is ignored.
22-
- `Exxxx` --- If the example is expected to fail to compile with a specific error code, include that code so that rustdoc will check that the expected code is used.
21+
- `ignore` --- The example shouldn't be built or tested. This should be avoided if possible. Usually, this is only necessary when the testing framework does not support it (such as external crates, modules, or a proc-macro) or when it contains pseudo-code that is not valid Rust. An HTML comment, such as `<!-- ignore: requires extern crate -->`, should be placed before the example to explain why it is ignored.
22+
- `Exxxx` --- If the example is expected to fail to compile with a specific error code, include that code so that `rustdoc` checks that the expected code is used.
2323

2424
See the [rustdoc documentation] for more detail.
2525

2626
## Combining examples
2727

28-
When demonstrating success cases, many such cases may be included in a single code block. For failure cases, however, each example must appear in a separate code block so that the tests can ensure that each case indeed fails and fails with the appropriate error code or codes.
28+
When demonstrating success cases, multiple cases may be included in a single code block. For failure cases, however, each example must appear in a separate code block so that the tests can ensure that each case indeed fails with the appropriate error code.
2929

3030
## Testing examples
3131

32-
The Rust code blocks are tested in CI. You can verify the samples pass by running [`mdbook test`].
32+
The Rust code blocks are tested in CI. You can verify that the samples pass by running [`mdbook test`].
3333

3434
[`mdbook test`]: tests.md#inline-tests
3535
[mdBook supported languages]: https://rust-lang.github.io/mdBook/format/theme/syntax-highlighting.html#supported-languages

0 commit comments

Comments
 (0)