Skip to content

Commit 98baa62

Browse files
committed
Add attributes.testing.test.duplicates
I don't really know what to say here, since rustc generates somewhat nonsense when there are duplicates.
1 parent cdc938e commit 98baa62

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/attributes/testing.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ The `test` attribute may only be applied to [free functions] that are monomorphi
3737
> * `()`
3838
> * `Result<T, E> where T: Termination, E: Debug`
3939
40+
r[attributes.testing.test.duplicates]
41+
Only the first instance of `test` on an function is honored. Subsequent `test` attributes are ignored.
4042
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. -->
4147
4248
> [!NOTE]
4349
> The test mode is enabled by passing the `--test` argument to `rustc` or using `cargo test`.

0 commit comments

Comments
 (0)