We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cdc938e commit 98baa62Copy full SHA for 98baa62
src/attributes/testing.md
@@ -37,7 +37,13 @@ The `test` attribute may only be applied to [free functions] that are monomorphi
37
> * `()`
38
> * `Result<T, E> where T: Termination, E: Debug`
39
40
+r[attributes.testing.test.duplicates]
41
+Only the first instance of `test` on an function is honored. Subsequent `test` attributes are ignored.
42
43
+> [!NOTE]
44
+> `rustc` currently warns on duplicate `test` attributes.
45
+
46
+<!-- TODO: This is a minor lie. Currently rustc warns that duplicates are ignored, but it then generates multiple test entries with the same name. I would vote for rejecting this in the future. -->
47
48
> [!NOTE]
49
> The test mode is enabled by passing the `--test` argument to `rustc` or using `cargo test`.
0 commit comments