Skip to content

Commit cdc938e

Browse files
committed
Reword attributes.testing.test.allowed-positions
This is just some rewording for some clarity.
1 parent c867c23 commit cdc938e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/attributes/testing.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ r[attributes.testing.test.syntax]
3030
The `test` attribute uses the [MetaWord] syntax and thus does not take any inputs.
3131
3232
r[attributes.testing.test.allowed-positions]
33-
Test functions must be free, monomorphic functions that take no arguments, and the return type must implement the [`Termination`] trait, for example:
33+
The `test` attribute may only be applied to [free functions] that are monomorphic, that take no arguments, and the return type must implement the [`Termination`] trait.
34+
35+
> [!NOTE]
36+
> Some of types that implement the [`Termination`] trait include:
37+
> * `()`
38+
> * `Result<T, E> where T: Termination, E: Debug`
3439
35-
* `()`
36-
* `Result<T, E> where T: Termination, E: Debug`
37-
* `!`
3840
39-
<!-- If the previous section needs updating (from "must take no arguments"
40-
onwards, also update it in the crates-and-source-files.md file -->
4141
4242
> [!NOTE]
4343
> The test mode is enabled by passing the `--test` argument to `rustc` or using `cargo test`.
@@ -116,3 +116,4 @@ fn mytest() {
116116
[`test` conditional compilation option]: ../conditional-compilation.md#test
117117
[attributes]: ../attributes.md
118118
[`ExitCode`]: std::process::ExitCode
119+
[free functions]: ../glossary.md#free-item

0 commit comments

Comments
 (0)