Skip to content

Commit f7b664c

Browse files
committed
Note invalid syntax currently accepted
We currently accept invalid syntax between the parentheses with `should_panic(..)`. Let's make a note of that.
1 parent 6215cd1 commit f7b664c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/attributes/testing.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ The `should_panic` attribute has one of the following forms:
161161
> fn mytest() { panic!("error: some message, and more"); }
162162
> ```
163163
164+
> [!NOTE]
165+
> `rustc` currently accepts the [MetaListNameValueStr] form with invalid syntax between the parentheses and emits a future-compatibility warning. This may become a hard error in the future.
166+
164167
r[attributes.testing.should_panic.allowed-positions]
165168
The `should_panic` attribute may only be applied to functions annotated with the `test` attribute.
166169

0 commit comments

Comments
 (0)