Skip to content
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

docs: Update tests chapter for Termination stabilization #96062

Merged
merged 1 commit into from
Apr 15, 2022
Merged
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
4 changes: 3 additions & 1 deletion src/doc/rustc/src/tests/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ fn it_works() {
```

Tests "pass" if they return without an error. They "fail" if they [panic], or
return a [`Result`] with an error.
return a type such as [`Result`] that implements the [`Termination`] trait
with a non-zero value.

By passing the [`--test` option] to `rustc`, the compiler will build the crate
in a special mode to construct an executable that will run the tests in the
Expand Down Expand Up @@ -304,6 +305,7 @@ Experimental support for using custom test harnesses is available on the
[`libtest`]: ../../test/index.html
[`main` function]: ../../reference/crates-and-source-files.html#main-functions
[`Result`]: ../../std/result/index.html
[`Termination`]: ../../std/process/trait.Termination.html
[`test` cfg option]: ../../reference/conditional-compilation.html#test
[attribute-ignore]: ../../reference/attributes/testing.html#the-ignore-attribute
[attribute-should_panic]: ../../reference/attributes/testing.html#the-should_panic-attribute
Expand Down