diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2025-08-11 17:02:32 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2025-08-11 17:02:32 +0000 |
| commit | 32ee26c625e8fbb7a3aa56788cbb352f04491964 (patch) | |
| tree | 7aa1e7f03f7f47ce16b3405859d41e35f32bd945 /tests/ui/test-attrs | |
| parent | 413ca5d9f0868f5d91a8b773ce60d70d5205c3f3 (diff) | |
| download | rust-32ee26c625e8fbb7a3aa56788cbb352f04491964.tar.gz rust-32ee26c625e8fbb7a3aa56788cbb352f04491964.zip | |
Add more docs to templates for attrs with incorrect arguments
Diffstat (limited to 'tests/ui/test-attrs')
| -rw-r--r-- | tests/ui/test-attrs/test-should-panic-attr.rs | 4 | ||||
| -rw-r--r-- | tests/ui/test-attrs/test-should-panic-attr.stderr | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/tests/ui/test-attrs/test-should-panic-attr.rs b/tests/ui/test-attrs/test-should-panic-attr.rs index af54689551c..e6de07d0094 100644 --- a/tests/ui/test-attrs/test-should-panic-attr.rs +++ b/tests/ui/test-attrs/test-should-panic-attr.rs @@ -10,6 +10,7 @@ fn test1() { #[should_panic(expected)] //~^ ERROR malformed `should_panic` attribute input //~| NOTE expected this to be of the form `expected = "..."` +//~| NOTE for more information, visit fn test2() { panic!(); } @@ -18,6 +19,7 @@ fn test2() { #[should_panic(expect)] //~^ ERROR malformed `should_panic` attribute input //~| NOTE the only valid argument here is "expected" +//~| NOTE for more information, visit fn test3() { panic!(); } @@ -26,6 +28,7 @@ fn test3() { #[should_panic(expected(foo, bar))] //~^ ERROR malformed `should_panic` attribute input //~| NOTE expected this to be of the form `expected = "..."` +//~| NOTE for more information, visit fn test4() { panic!(); } @@ -34,6 +37,7 @@ fn test4() { #[should_panic(expected = "foo", bar)] //~^ ERROR malformed `should_panic` attribute input //~| NOTE expected a single argument here +//~| NOTE for more information, visit fn test5() { panic!(); } diff --git a/tests/ui/test-attrs/test-should-panic-attr.stderr b/tests/ui/test-attrs/test-should-panic-attr.stderr index 5dfc8e503e8..475a55ad0cb 100644 --- a/tests/ui/test-attrs/test-should-panic-attr.stderr +++ b/tests/ui/test-attrs/test-should-panic-attr.stderr @@ -6,6 +6,7 @@ LL | #[should_panic(expected)] | | | expected this to be of the form `expected = "..."` | + = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/testing.html#the-should_panic-attribute> help: try changing it to one of the following valid forms of the attribute | LL - #[should_panic(expected)] @@ -18,13 +19,14 @@ LL + #[should_panic] | error[E0539]: malformed `should_panic` attribute input - --> $DIR/test-should-panic-attr.rs:18:1 + --> $DIR/test-should-panic-attr.rs:19:1 | LL | #[should_panic(expect)] | ^^^^^^^^^^^^^^--------^ | | | the only valid argument here is "expected" | + = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/testing.html#the-should_panic-attribute> help: try changing it to one of the following valid forms of the attribute | LL - #[should_panic(expect)] @@ -37,13 +39,14 @@ LL + #[should_panic] | error[E0539]: malformed `should_panic` attribute input - --> $DIR/test-should-panic-attr.rs:26:1 + --> $DIR/test-should-panic-attr.rs:28:1 | LL | #[should_panic(expected(foo, bar))] | ^^^^^^^^^^^^^^^------------------^^ | | | expected this to be of the form `expected = "..."` | + = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/testing.html#the-should_panic-attribute> help: try changing it to one of the following valid forms of the attribute | LL - #[should_panic(expected(foo, bar))] @@ -57,13 +60,14 @@ LL + #[should_panic] | error[E0805]: malformed `should_panic` attribute input - --> $DIR/test-should-panic-attr.rs:34:1 + --> $DIR/test-should-panic-attr.rs:37:1 | LL | #[should_panic(expected = "foo", bar)] | ^^^^^^^^^^^^^^-----------------------^ | | | expected a single argument here | + = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/testing.html#the-should_panic-attribute> help: try changing it to one of the following valid forms of the attribute | LL - #[should_panic(expected = "foo", bar)] |
