Extended the note on the use of no_run
attribute
This commit is contained in:
parent
092e1c9d23
commit
8fd8db5c29
1 changed files with 2 additions and 1 deletions
|
@ -335,7 +335,8 @@ panic during execution. If the code doesn't panic, the test will fail.
|
||||||
The `no_run` attribute will compile your code but not run it. This is
|
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,"
|
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
|
which you would want to ensure compiles, but might be run in a test
|
||||||
environment that has no network access.
|
environment that has no network access. This attribute can also be
|
||||||
|
used to demonstrate code snippets that can cause Undefined Behavior.
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
/// ```no_run
|
/// ```no_run
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue