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 | |
| 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')
28 files changed, 169 insertions, 41 deletions
diff --git a/tests/ui/attributes/invalid-macro-use.rs b/tests/ui/attributes/invalid-macro-use.rs index cfb13fd183c..52e4608303f 100644 --- a/tests/ui/attributes/invalid-macro-use.rs +++ b/tests/ui/attributes/invalid-macro-use.rs @@ -8,21 +8,25 @@ extern crate std as s1; #[macro_use(5)] //~^ ERROR malformed `macro_use` attribute input //~| NOTE expected a valid identifier here +//~| NOTE for more information, visit extern crate std as s2; #[macro_use(a = "b")] //~^ ERROR malformed `macro_use` attribute input //~| NOTE didn't expect any arguments here +//~| NOTE for more information, visit extern crate std as s3; #[macro_use(a(b))] //~^ ERROR malformed `macro_use` attribute input //~| NOTE didn't expect any arguments here +//~| NOTE for more information, visit extern crate std as s4; #[macro_use(a::b)] //~^ ERROR malformed `macro_use` attribute input //~| NOTE expected a valid identifier here +//~| NOTE for more information, visit extern crate std as s5; #[macro_use(a)] diff --git a/tests/ui/attributes/invalid-macro-use.stderr b/tests/ui/attributes/invalid-macro-use.stderr index 4f5db5c558a..ff3ed6196d3 100644 --- a/tests/ui/attributes/invalid-macro-use.stderr +++ b/tests/ui/attributes/invalid-macro-use.stderr @@ -1,11 +1,11 @@ error[E0469]: imported macro not found - --> $DIR/invalid-macro-use.rs:47:13 + --> $DIR/invalid-macro-use.rs:51:13 | LL | #[macro_use(a)] | ^ error[E0469]: imported macro not found - --> $DIR/invalid-macro-use.rs:49:13 + --> $DIR/invalid-macro-use.rs:53:13 | LL | #[macro_use(b)] | ^ @@ -24,6 +24,7 @@ LL | #[macro_use(5)] | | | expected a valid identifier here | + = note: for more information, visit <https://doc.rust-lang.org/reference/macros-by-example.html#the-macro_use-attribute> help: try changing it to one of the following valid forms of the attribute | LL - #[macro_use(5)] @@ -34,13 +35,14 @@ LL + #[macro_use] | error[E0565]: malformed `macro_use` attribute input - --> $DIR/invalid-macro-use.rs:13:1 + --> $DIR/invalid-macro-use.rs:14:1 | LL | #[macro_use(a = "b")] | ^^^^^^^^^^^^^^-----^^ | | | didn't expect any arguments here | + = note: for more information, visit <https://doc.rust-lang.org/reference/macros-by-example.html#the-macro_use-attribute> help: try changing it to one of the following valid forms of the attribute | LL - #[macro_use(a = "b")] @@ -51,13 +53,14 @@ LL + #[macro_use] | error[E0565]: malformed `macro_use` attribute input - --> $DIR/invalid-macro-use.rs:18:1 + --> $DIR/invalid-macro-use.rs:20:1 | LL | #[macro_use(a(b))] | ^^^^^^^^^^^^^---^^ | | | didn't expect any arguments here | + = note: for more information, visit <https://doc.rust-lang.org/reference/macros-by-example.html#the-macro_use-attribute> help: try changing it to one of the following valid forms of the attribute | LL - #[macro_use(a(b))] @@ -68,13 +71,14 @@ LL + #[macro_use] | error[E0539]: malformed `macro_use` attribute input - --> $DIR/invalid-macro-use.rs:23:1 + --> $DIR/invalid-macro-use.rs:26:1 | LL | #[macro_use(a::b)] | ^^^^^^^^^^^^----^^ | | | expected a valid identifier here | + = note: for more information, visit <https://doc.rust-lang.org/reference/macros-by-example.html#the-macro_use-attribute> help: try changing it to one of the following valid forms of the attribute | LL - #[macro_use(a::b)] @@ -85,13 +89,13 @@ LL + #[macro_use] | error: unused attribute - --> $DIR/invalid-macro-use.rs:28:1 + --> $DIR/invalid-macro-use.rs:32:1 | LL | #[macro_use(a)] | ^^^^^^^^^^^^^^^ help: remove this attribute | note: attribute also specified here - --> $DIR/invalid-macro-use.rs:30:1 + --> $DIR/invalid-macro-use.rs:34:1 | LL | #[macro_use] | ^^^^^^^^^^^^ @@ -102,25 +106,25 @@ LL | #![deny(unused_attributes)] | ^^^^^^^^^^^^^^^^^ error: unused attribute - --> $DIR/invalid-macro-use.rs:36:1 + --> $DIR/invalid-macro-use.rs:40:1 | LL | #[macro_use(a)] | ^^^^^^^^^^^^^^^ help: remove this attribute | note: attribute also specified here - --> $DIR/invalid-macro-use.rs:34:1 + --> $DIR/invalid-macro-use.rs:38:1 | LL | #[macro_use] | ^^^^^^^^^^^^ error: unused attribute - --> $DIR/invalid-macro-use.rs:42:1 + --> $DIR/invalid-macro-use.rs:46:1 | LL | #[macro_use] | ^^^^^^^^^^^^ help: remove this attribute | note: attribute also specified here - --> $DIR/invalid-macro-use.rs:40:1 + --> $DIR/invalid-macro-use.rs:44:1 | LL | #[macro_use] | ^^^^^^^^^^^^ diff --git a/tests/ui/attributes/malformed-attrs.stderr b/tests/ui/attributes/malformed-attrs.stderr index 3a27b6505bc..0e422ff353c 100644 --- a/tests/ui/attributes/malformed-attrs.stderr +++ b/tests/ui/attributes/malformed-attrs.stderr @@ -6,6 +6,8 @@ LL | #[cfg] | | | expected this to be a list | help: must be of the form: `#[cfg(predicate)]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute> error: malformed `cfg_attr` attribute input --> $DIR/malformed-attrs.rs:101:1 @@ -354,7 +356,16 @@ error[E0539]: malformed `rustc_macro_transparency` attribute input --> $DIR/malformed-attrs.rs:43:1 | LL | #[rustc_macro_transparency] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[rustc_macro_transparency = "transparent|semitransparent|opaque"]` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: try changing it to one of the following valid forms of the attribute + | +LL | #[rustc_macro_transparency = "opaque"] + | ++++++++++ +LL | #[rustc_macro_transparency = "semitransparent"] + | +++++++++++++++++++ +LL | #[rustc_macro_transparency = "transparent"] + | +++++++++++++++ error[E0539]: malformed `repr` attribute input --> $DIR/malformed-attrs.rs:45:1 @@ -362,6 +373,7 @@ error[E0539]: malformed `repr` attribute input LL | #[repr] | ^^^^^^^ expected this to be a list | + = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> help: try changing it to one of the following valid forms of the attribute | LL | #[repr(<integer type>)] @@ -496,12 +508,16 @@ error[E0539]: malformed `link_name` attribute input | LL | #[link_name] | ^^^^^^^^^^^^ help: must be of the form: `#[link_name = "name"]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_name-attribute> error[E0539]: malformed `link_section` attribute input --> $DIR/malformed-attrs.rs:85:1 | LL | #[link_section] | ^^^^^^^^^^^^^^^ help: must be of the form: `#[link_section = "name"]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/abi.html#the-link_section-attribute> error[E0539]: malformed `coverage` attribute input --> $DIR/malformed-attrs.rs:87:1 @@ -560,6 +576,7 @@ LL | #[must_use = 1] | | | expected a string literal here | + = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute> help: try changing it to one of the following valid forms of the attribute | LL - #[must_use = 1] @@ -575,6 +592,7 @@ error[E0539]: malformed `proc_macro_derive` attribute input LL | #[proc_macro_derive] | ^^^^^^^^^^^^^^^^^^^^ expected this to be a list | + = note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros> help: try changing it to one of the following valid forms of the attribute | LL | #[proc_macro_derive(TraitName)] @@ -635,6 +653,8 @@ LL | #[link_ordinal] | | | expected this to be a list | help: must be of the form: `#[link_ordinal(ordinal)]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_ordinal-attribute> error[E0565]: malformed `ffi_const` attribute input --> $DIR/malformed-attrs.rs:168:5 diff --git a/tests/ui/attributes/malformed-reprs.stderr b/tests/ui/attributes/malformed-reprs.stderr index b60ba48f6f1..43085b9c341 100644 --- a/tests/ui/attributes/malformed-reprs.stderr +++ b/tests/ui/attributes/malformed-reprs.stderr @@ -4,6 +4,7 @@ error[E0539]: malformed `repr` attribute input LL | #![repr] | ^^^^^^^^ expected this to be a list | + = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> help: try changing it to one of the following valid forms of the attribute | LL - #![repr] diff --git a/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr b/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr index 5405c0ad99e..107e053ae0c 100644 --- a/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr +++ b/tests/ui/attributes/unsafe/proc-unsafe-attributes.stderr @@ -122,6 +122,7 @@ LL | #[proc_macro_derive(unsafe(Foo))] | | | didn't expect any arguments here | + = note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros> help: try changing it to one of the following valid forms of the attribute | LL - #[proc_macro_derive(unsafe(Foo))] diff --git a/tests/ui/cfg/cfg-target-compact-errors.stderr b/tests/ui/cfg/cfg-target-compact-errors.stderr index 7df6729e881..cf61f94278a 100644 --- a/tests/ui/cfg/cfg-target-compact-errors.stderr +++ b/tests/ui/cfg/cfg-target-compact-errors.stderr @@ -6,6 +6,8 @@ LL | #[cfg(target(o::o))] | | | | | expected this to be of the form `... = "..."` | help: must be of the form: `#[cfg(predicate)]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute> error[E0539]: malformed `cfg` attribute input --> $DIR/cfg-target-compact-errors.rs:9:1 @@ -15,6 +17,8 @@ LL | #[cfg(target(os = 8))] | | | | | expected a string literal here | help: must be of the form: `#[cfg(predicate)]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute> error[E0539]: malformed `cfg` attribute input --> $DIR/cfg-target-compact-errors.rs:13:1 @@ -24,6 +28,8 @@ LL | #[cfg(target(os = "linux", pointer(width = "64")))] | | | | | expected this to be of the form `... = "..."` | help: must be of the form: `#[cfg(predicate)]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute> error[E0539]: malformed `cfg` attribute input --> $DIR/cfg-target-compact-errors.rs:17:1 @@ -33,6 +39,8 @@ LL | #[cfg(target(true))] | | | | | expected this to be of the form `... = "..."` | help: must be of the form: `#[cfg(predicate)]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute> error: `cfg` predicate key must be an identifier --> $DIR/cfg-target-compact-errors.rs:21:14 diff --git a/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs b/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs index df87a3d846e..126a534dc6f 100644 --- a/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs +++ b/tests/ui/conditional-compilation/cfg-attr-syntax-validation.rs @@ -1,21 +1,25 @@ #[cfg] //~^ ERROR malformed `cfg` attribute //~| NOTE expected this to be a list +//~| NOTE for more information, visit struct S1; #[cfg = 10] //~^ ERROR malformed `cfg` attribute //~| NOTE expected this to be a list +//~| NOTE for more information, visit struct S2; #[cfg()] //~^ ERROR malformed `cfg` attribute //~| NOTE expected a single argument here +//~| NOTE for more information, visit struct S3; #[cfg(a, b)] //~^ ERROR malformed `cfg` attribute //~| NOTE expected a single argument here +//~| NOTE for more information, visit struct S4; #[cfg("str")] //~ ERROR `cfg` predicate key must be an identifier @@ -29,6 +33,7 @@ struct S7; #[cfg(a = 10)] //~ ERROR malformed `cfg` attribute input //~^ NOTE expected a string literal here +//~| NOTE for more information, visit struct S8; #[cfg(a = b"hi")] //~ ERROR malformed `cfg` attribute input diff --git a/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr b/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr index 75e9b9209c0..6acde758ea5 100644 --- a/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr +++ b/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr @@ -6,63 +6,73 @@ LL | #[cfg] | | | expected this to be a list | help: must be of the form: `#[cfg(predicate)]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute> error[E0539]: malformed `cfg` attribute input - --> $DIR/cfg-attr-syntax-validation.rs:6:1 + --> $DIR/cfg-attr-syntax-validation.rs:7:1 | LL | #[cfg = 10] | ^^^^^^^^^^^ | | | expected this to be a list | help: must be of the form: `#[cfg(predicate)]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute> error[E0805]: malformed `cfg` attribute input - --> $DIR/cfg-attr-syntax-validation.rs:11:1 + --> $DIR/cfg-attr-syntax-validation.rs:13:1 | LL | #[cfg()] | ^^^^^--^ | | | | | expected a single argument here | help: must be of the form: `#[cfg(predicate)]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute> error[E0805]: malformed `cfg` attribute input - --> $DIR/cfg-attr-syntax-validation.rs:16:1 + --> $DIR/cfg-attr-syntax-validation.rs:19:1 | LL | #[cfg(a, b)] | ^^^^^------^ | | | | | expected a single argument here | help: must be of the form: `#[cfg(predicate)]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute> error: `cfg` predicate key must be an identifier - --> $DIR/cfg-attr-syntax-validation.rs:21:7 + --> $DIR/cfg-attr-syntax-validation.rs:25:7 | LL | #[cfg("str")] | ^^^^^ error: `cfg` predicate key must be an identifier - --> $DIR/cfg-attr-syntax-validation.rs:24:7 + --> $DIR/cfg-attr-syntax-validation.rs:28:7 | LL | #[cfg(a::b)] | ^^^^ error[E0537]: invalid predicate `a` - --> $DIR/cfg-attr-syntax-validation.rs:27:7 + --> $DIR/cfg-attr-syntax-validation.rs:31:7 | LL | #[cfg(a())] | ^^^ error[E0539]: malformed `cfg` attribute input - --> $DIR/cfg-attr-syntax-validation.rs:30:1 + --> $DIR/cfg-attr-syntax-validation.rs:34:1 | LL | #[cfg(a = 10)] | ^^^^^^^^^^--^^ | | | | | expected a string literal here | help: must be of the form: `#[cfg(predicate)]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute> error[E0539]: malformed `cfg` attribute input - --> $DIR/cfg-attr-syntax-validation.rs:34:1 + --> $DIR/cfg-attr-syntax-validation.rs:39:1 | LL | #[cfg(a = b"hi")] | ^^^^^^^^^^-^^^^^^ @@ -72,7 +82,7 @@ LL | #[cfg(a = b"hi")] = note: expected a normal string literal, not a byte string literal error: expected unsuffixed literal, found `expr` metavariable - --> $DIR/cfg-attr-syntax-validation.rs:40:25 + --> $DIR/cfg-attr-syntax-validation.rs:45:25 | LL | #[cfg(feature = $expr)] | ^^^^^ diff --git a/tests/ui/error-codes/E0540.stderr b/tests/ui/error-codes/E0540.stderr index 365ceee95da..ae23dce5c50 100644 --- a/tests/ui/error-codes/E0540.stderr +++ b/tests/ui/error-codes/E0540.stderr @@ -6,6 +6,7 @@ LL | #[inline()] | | | expected a single argument here | + = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/codegen.html#the-inline-attribute> help: try changing it to one of the following valid forms of the attribute | LL | #[inline(always)] diff --git a/tests/ui/extern/issue-47725.rs b/tests/ui/extern/issue-47725.rs index 60d0cd62347..8ac866dc7d9 100644 --- a/tests/ui/extern/issue-47725.rs +++ b/tests/ui/extern/issue-47725.rs @@ -17,6 +17,7 @@ extern "C" { #[link_name] //~^ ERROR malformed `link_name` attribute input //~| HELP must be of the form +//~| NOTE for more information, visit extern "C" { fn bar() -> u32; } diff --git a/tests/ui/extern/issue-47725.stderr b/tests/ui/extern/issue-47725.stderr index 4fd02a1778b..c5af54b8029 100644 --- a/tests/ui/extern/issue-47725.stderr +++ b/tests/ui/extern/issue-47725.stderr @@ -3,6 +3,8 @@ error[E0539]: malformed `link_name` attribute input | LL | #[link_name] | ^^^^^^^^^^^^ help: must be of the form: `#[link_name = "name"]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_name-attribute> warning: attribute should be applied to a foreign function or static --> $DIR/issue-47725.rs:3:1 diff --git a/tests/ui/invalid/invalid-inline.stderr b/tests/ui/invalid/invalid-inline.stderr index 8fe9b9748bd..78ffe3270a7 100644 --- a/tests/ui/invalid/invalid-inline.stderr +++ b/tests/ui/invalid/invalid-inline.stderr @@ -6,6 +6,7 @@ LL | #[inline(please,no)] | | | expected a single argument here | + = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/codegen.html#the-inline-attribute> help: try changing it to one of the following valid forms of the attribute | LL - #[inline(please,no)] @@ -26,6 +27,7 @@ LL | #[inline()] | | | expected a single argument here | + = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/codegen.html#the-inline-attribute> help: try changing it to one of the following valid forms of the attribute | LL | #[inline(always)] diff --git a/tests/ui/issues/issue-43988.stderr b/tests/ui/issues/issue-43988.stderr index 7564004f44f..b50d691e685 100644 --- a/tests/ui/issues/issue-43988.stderr +++ b/tests/ui/issues/issue-43988.stderr @@ -6,6 +6,7 @@ LL | #[inline(XYZ)] | | | valid arguments are `always` or `never` | + = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/codegen.html#the-inline-attribute> help: try changing it to one of the following valid forms of the attribute | LL - #[inline(XYZ)] @@ -42,6 +43,7 @@ error[E0539]: malformed `repr` attribute input LL | #[repr] | ^^^^^^^ expected this to be a list | + = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> help: try changing it to one of the following valid forms of the attribute | LL | #[repr(<integer type>)] @@ -62,6 +64,7 @@ LL | #[inline(ABC)] | | | valid arguments are `always` or `never` | + = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/codegen.html#the-inline-attribute> help: try changing it to one of the following valid forms of the attribute | LL - #[inline(ABC)] @@ -80,6 +83,7 @@ error[E0539]: malformed `repr` attribute input LL | let _z = #[repr] 1; | ^^^^^^^ expected this to be a list | + = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> help: try changing it to one of the following valid forms of the attribute | LL | let _z = #[repr(<integer type>)] 1; diff --git a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.stderr b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.stderr index ffae30aabcc..6bf1eab311a 100644 --- a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.stderr +++ b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-invalid-format.stderr @@ -6,6 +6,8 @@ LL | #[link_ordinal("JustMonika")] | | | | | expected an integer literal here | help: must be of the form: `#[link_ordinal(ordinal)]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_ordinal-attribute> error[E0539]: malformed `link_ordinal` attribute input --> $DIR/link-ordinal-invalid-format.rs:6:5 @@ -15,6 +17,8 @@ LL | #[link_ordinal("JustMonika")] | | | | | expected an integer literal here | help: must be of the form: `#[link_ordinal(ordinal)]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_ordinal-attribute> error: aborting due to 2 previous errors diff --git a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.rs b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.rs index 2a8b9ebacf7..58f19085540 100644 --- a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.rs +++ b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.rs @@ -3,10 +3,12 @@ extern "C" { #[link_ordinal()] //~^ ERROR malformed `link_ordinal` attribute input //~| NOTE expected a single argument + //~| NOTE for more information, visit fn foo(); #[link_ordinal()] //~^ ERROR malformed `link_ordinal` attribute input //~| NOTE expected a single argument + //~| NOTE for more information, visit static mut imported_variable: i32; } diff --git a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.stderr b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.stderr index c6b8a18d03a..d575b0961af 100644 --- a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.stderr +++ b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-missing-argument.stderr @@ -6,15 +6,19 @@ LL | #[link_ordinal()] | | | | | expected a single argument here | help: must be of the form: `#[link_ordinal(ordinal)]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_ordinal-attribute> error[E0805]: malformed `link_ordinal` attribute input - --> $DIR/link-ordinal-missing-argument.rs:7:5 + --> $DIR/link-ordinal-missing-argument.rs:8:5 | LL | #[link_ordinal()] | ^^^^^^^^^^^^^^--^ | | | | | expected a single argument here | help: must be of the form: `#[link_ordinal(ordinal)]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_ordinal-attribute> error: aborting due to 2 previous errors diff --git a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.rs b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.rs index ddf9583352f..55b18ae0d96 100644 --- a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.rs +++ b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.rs @@ -3,10 +3,12 @@ extern "C" { #[link_ordinal(3, 4)] //~^ ERROR malformed `link_ordinal` attribute input //~| NOTE expected a single argument + //~| NOTE for more information, visit fn foo(); #[link_ordinal(3, 4)] //~^ ERROR malformed `link_ordinal` attribute input //~| NOTE expected a single argument + //~| NOTE for more information, visit static mut imported_variable: i32; } diff --git a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.stderr b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.stderr index 7d63304f598..a84fef9f9e4 100644 --- a/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.stderr +++ b/tests/ui/linkage-attr/raw-dylib/windows/link-ordinal-too-many-arguments.stderr @@ -6,15 +6,19 @@ LL | #[link_ordinal(3, 4)] | | | | | expected a single argument here | help: must be of the form: `#[link_ordinal(ordinal)]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_ordinal-attribute> error[E0805]: malformed `link_ordinal` attribute input - --> $DIR/link-ordinal-too-many-arguments.rs:7:5 + --> $DIR/link-ordinal-too-many-arguments.rs:8:5 | LL | #[link_ordinal(3, 4)] | ^^^^^^^^^^^^^^------^ | | | | | expected a single argument here | help: must be of the form: `#[link_ordinal(ordinal)]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_ordinal-attribute> error: aborting due to 2 previous errors diff --git a/tests/ui/macros/macro-use-bad-args-1.stderr b/tests/ui/macros/macro-use-bad-args-1.stderr index 2f43d0997df..542b4ae2b7a 100644 --- a/tests/ui/macros/macro-use-bad-args-1.stderr +++ b/tests/ui/macros/macro-use-bad-args-1.stderr @@ -6,6 +6,7 @@ LL | #[macro_use(foo(bar))] | | | didn't expect any arguments here | + = note: for more information, visit <https://doc.rust-lang.org/reference/macros-by-example.html#the-macro_use-attribute> help: try changing it to one of the following valid forms of the attribute | LL - #[macro_use(foo(bar))] diff --git a/tests/ui/macros/macro-use-bad-args-2.stderr b/tests/ui/macros/macro-use-bad-args-2.stderr index d7b03c93588..2db9ffe50b0 100644 --- a/tests/ui/macros/macro-use-bad-args-2.stderr +++ b/tests/ui/macros/macro-use-bad-args-2.stderr @@ -6,6 +6,7 @@ LL | #[macro_use(foo="bar")] | | | didn't expect any arguments here | + = note: for more information, visit <https://doc.rust-lang.org/reference/macros-by-example.html#the-macro_use-attribute> help: try changing it to one of the following valid forms of the attribute | LL - #[macro_use(foo="bar")] diff --git a/tests/ui/parser/bad-lit-suffixes.stderr b/tests/ui/parser/bad-lit-suffixes.stderr index 7876d75c5a4..9a51cf70960 100644 --- a/tests/ui/parser/bad-lit-suffixes.stderr +++ b/tests/ui/parser/bad-lit-suffixes.stderr @@ -158,6 +158,7 @@ LL | #[must_use = "string"suffix] | | | expected a string literal here | + = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-must_use-attribute> help: try changing it to one of the following valid forms of the attribute | LL - #[must_use = "string"suffix] diff --git a/tests/ui/proc-macro/attribute.rs b/tests/ui/proc-macro/attribute.rs index 988cdcd0403..dfb26738377 100644 --- a/tests/ui/proc-macro/attribute.rs +++ b/tests/ui/proc-macro/attribute.rs @@ -9,46 +9,55 @@ use proc_macro::*; #[proc_macro_derive] //~^ ERROR malformed `proc_macro_derive` attribute //~| NOTE expected this to be a list +//~| NOTE for more information, visit pub fn foo1(input: TokenStream) -> TokenStream { input } #[proc_macro_derive = ""] //~^ ERROR malformed `proc_macro_derive` attribute //~| NOTE expected this to be a list +//~| NOTE for more information, visit pub fn foo2(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d3, a, b)] //~^ ERROR malformed `proc_macro_derive` attribute //~| NOTE the only valid argument here is `attributes` +//~| NOTE for more information, visit pub fn foo3(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d4, attributes(a), b)] //~^ ERROR malformed `proc_macro_derive` attribute //~| NOTE didn't expect any arguments here +//~| NOTE for more information, visit pub fn foo4(input: TokenStream) -> TokenStream { input } #[proc_macro_derive("a")] //~^ ERROR malformed `proc_macro_derive` attribute //~| NOTE didn't expect a literal here +//~| NOTE for more information, visit pub fn foo5(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d6 = "")] //~^ ERROR malformed `proc_macro_derive` attribute //~| NOTE didn't expect any arguments here +//~| NOTE for more information, visit pub fn foo6(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(m::d7)] //~^ ERROR malformed `proc_macro_derive` attribute //~| NOTE expected a valid identifier here +//~| NOTE for more information, visit pub fn foo7(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d8(a))] //~^ ERROR malformed `proc_macro_derive` attribute //~| NOTE didn't expect any arguments here +//~| NOTE for more information, visit pub fn foo8(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(self)] //~^ ERROR malformed `proc_macro_derive` attribute //~| NOTE expected a valid identifier here +//~| NOTE for more information, visit pub fn foo9(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(PartialEq)] // OK @@ -57,34 +66,41 @@ pub fn foo10(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d11, a)] //~^ ERROR malformed `proc_macro_derive` attribute //~| NOTE the only valid argument here is `attributes` +//~| NOTE for more information, visit pub fn foo11(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d12, attributes)] //~^ ERROR malformed `proc_macro_derive` attribute //~| NOTE expected this to be a list +//~| NOTE for more information, visit pub fn foo12(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d13, attributes("a"))] //~^ ERROR malformed `proc_macro_derive` attribute //~| NOTE expected a valid identifier here +//~| NOTE for more information, visit pub fn foo13(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d14, attributes(a = ""))] //~^ ERROR malformed `proc_macro_derive` attribute //~| NOTE didn't expect any arguments here +//~| NOTE for more information, visit pub fn foo14(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d15, attributes(m::a))] //~^ ERROR malformed `proc_macro_derive` attribute //~| NOTE expected a valid identifier here +//~| NOTE for more information, visit pub fn foo15(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d16, attributes(a(b)))] //~^ ERROR malformed `proc_macro_derive` attribute //~| NOTE didn't expect any arguments here +//~| NOTE for more information, visit pub fn foo16(input: TokenStream) -> TokenStream { input } #[proc_macro_derive(d17, attributes(self))] //~^ ERROR malformed `proc_macro_derive` attribute //~| NOTE expected a valid identifier here +//~| NOTE for more information, visit pub fn foo17(input: TokenStream) -> TokenStream { input } diff --git a/tests/ui/proc-macro/attribute.stderr b/tests/ui/proc-macro/attribute.stderr index ea92e93e93f..e7127c8ef1d 100644 --- a/tests/ui/proc-macro/attribute.stderr +++ b/tests/ui/proc-macro/attribute.stderr @@ -4,6 +4,7 @@ error[E0539]: malformed `proc_macro_derive` attribute input LL | #[proc_macro_derive] | ^^^^^^^^^^^^^^^^^^^^ expected this to be a list | + = note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros> help: try changing it to one of the following valid forms of the attribute | LL | #[proc_macro_derive(TraitName)] @@ -12,11 +13,12 @@ LL | #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | ++++++++++++++++++++++++++++++++++++++++++ error[E0539]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:14:1 + --> $DIR/attribute.rs:15:1 | LL | #[proc_macro_derive = ""] | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected this to be a list | + = note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros> help: try changing it to one of the following valid forms of the attribute | LL - #[proc_macro_derive = ""] @@ -27,13 +29,14 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0539]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:19:1 + --> $DIR/attribute.rs:21:1 | LL | #[proc_macro_derive(d3, a, b)] | ^^^^^^^^^^^^^^^^^^^^^^^^-^^^^^ | | | the only valid argument here is `attributes` | + = note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros> help: try changing it to one of the following valid forms of the attribute | LL - #[proc_macro_derive(d3, a, b)] @@ -44,13 +47,14 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0565]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:24:1 + --> $DIR/attribute.rs:27:1 | LL | #[proc_macro_derive(d4, attributes(a), b)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^^ | | | didn't expect any arguments here | + = note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros> help: try changing it to one of the following valid forms of the attribute | LL - #[proc_macro_derive(d4, attributes(a), b)] @@ -61,13 +65,14 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0565]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:29:1 + --> $DIR/attribute.rs:33:1 | LL | #[proc_macro_derive("a")] | ^^^^^^^^^^^^^^^^^^^^---^^ | | | didn't expect a literal here | + = note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros> help: try changing it to one of the following valid forms of the attribute | LL - #[proc_macro_derive("a")] @@ -78,13 +83,14 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0565]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:34:1 + --> $DIR/attribute.rs:39:1 | LL | #[proc_macro_derive(d6 = "")] | ^^^^^^^^^^^^^^^^^^^^^^^----^^ | | | didn't expect any arguments here | + = note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros> help: try changing it to one of the following valid forms of the attribute | LL - #[proc_macro_derive(d6 = "")] @@ -95,13 +101,14 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0539]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:39:1 + --> $DIR/attribute.rs:45:1 | LL | #[proc_macro_derive(m::d7)] | ^^^^^^^^^^^^^^^^^^^^-----^^ | | | expected a valid identifier here | + = note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros> help: try changing it to one of the following valid forms of the attribute | LL - #[proc_macro_derive(m::d7)] @@ -112,13 +119,14 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0565]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:44:1 + --> $DIR/attribute.rs:51:1 | LL | #[proc_macro_derive(d8(a))] | ^^^^^^^^^^^^^^^^^^^^^^---^^ | | | didn't expect any arguments here | + = note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros> help: try changing it to one of the following valid forms of the attribute | LL - #[proc_macro_derive(d8(a))] @@ -129,13 +137,14 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0539]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:49:1 + --> $DIR/attribute.rs:57:1 | LL | #[proc_macro_derive(self)] | ^^^^^^^^^^^^^^^^^^^^----^^ | | | expected a valid identifier here | + = note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros> help: try changing it to one of the following valid forms of the attribute | LL - #[proc_macro_derive(self)] @@ -146,13 +155,14 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0539]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:57:1 + --> $DIR/attribute.rs:66:1 | LL | #[proc_macro_derive(d11, a)] | ^^^^^^^^^^^^^^^^^^^^^^^^^-^^ | | | the only valid argument here is `attributes` | + = note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros> help: try changing it to one of the following valid forms of the attribute | LL - #[proc_macro_derive(d11, a)] @@ -163,13 +173,14 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0539]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:62:1 + --> $DIR/attribute.rs:72:1 | LL | #[proc_macro_derive(d12, attributes)] | ^^^^^^^^^^^^^^^^^^^^^^^^^----------^^ | | | expected this to be a list | + = note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros> help: try changing it to one of the following valid forms of the attribute | LL - #[proc_macro_derive(d12, attributes)] @@ -180,13 +191,14 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0539]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:67:1 + --> $DIR/attribute.rs:78:1 | LL | #[proc_macro_derive(d13, attributes("a"))] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^^^ | | | expected a valid identifier here | + = note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros> help: try changing it to one of the following valid forms of the attribute | LL - #[proc_macro_derive(d13, attributes("a"))] @@ -197,13 +209,14 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0565]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:72:1 + --> $DIR/attribute.rs:84:1 | LL | #[proc_macro_derive(d14, attributes(a = ""))] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----^^^ | | | didn't expect any arguments here | + = note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros> help: try changing it to one of the following valid forms of the attribute | LL - #[proc_macro_derive(d14, attributes(a = ""))] @@ -214,13 +227,14 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0539]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:77:1 + --> $DIR/attribute.rs:90:1 | LL | #[proc_macro_derive(d15, attributes(m::a))] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----^^^ | | | expected a valid identifier here | + = note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros> help: try changing it to one of the following valid forms of the attribute | LL - #[proc_macro_derive(d15, attributes(m::a))] @@ -231,13 +245,14 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0565]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:82:1 + --> $DIR/attribute.rs:96:1 | LL | #[proc_macro_derive(d16, attributes(a(b)))] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---^^^ | | | didn't expect any arguments here | + = note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros> help: try changing it to one of the following valid forms of the attribute | LL - #[proc_macro_derive(d16, attributes(a(b)))] @@ -248,13 +263,14 @@ LL + #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] | error[E0539]: malformed `proc_macro_derive` attribute input - --> $DIR/attribute.rs:87:1 + --> $DIR/attribute.rs:102:1 | LL | #[proc_macro_derive(d17, attributes(self))] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----^^^ | | | expected a valid identifier here | + = note: for more information, visit <https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros> help: try changing it to one of the following valid forms of the attribute | LL - #[proc_macro_derive(d17, attributes(self))] diff --git a/tests/ui/repr/repr.stderr b/tests/ui/repr/repr.stderr index 83e0cdfe741..d4faea12517 100644 --- a/tests/ui/repr/repr.stderr +++ b/tests/ui/repr/repr.stderr @@ -4,6 +4,7 @@ error[E0539]: malformed `repr` attribute input LL | #[repr] | ^^^^^^^ expected this to be a list | + = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> help: try changing it to one of the following valid forms of the attribute | LL | #[repr(<integer type>)] @@ -22,6 +23,7 @@ error[E0539]: malformed `repr` attribute input LL | #[repr = "B"] | ^^^^^^^^^^^^^ expected this to be a list | + = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> help: try changing it to one of the following valid forms of the attribute | LL - #[repr = "B"] @@ -44,6 +46,7 @@ error[E0539]: malformed `repr` attribute input LL | #[repr = "C"] | ^^^^^^^^^^^^^ expected this to be a list | + = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> help: try changing it to one of the following valid forms of the attribute | LL - #[repr = "C"] diff --git a/tests/ui/resolve/path-attr-in-const-block.stderr b/tests/ui/resolve/path-attr-in-const-block.stderr index 0b5942a287d..f3ae5b60c4f 100644 --- a/tests/ui/resolve/path-attr-in-const-block.stderr +++ b/tests/ui/resolve/path-attr-in-const-block.stderr @@ -12,6 +12,8 @@ LL | #![path = foo!()] | | | | | expected a string literal here | help: must be of the form: `#[path = "file"]` + | + = note: for more information, visit <https://doc.rust-lang.org/reference/items/modules.html#the-path-attribute> error: aborting due to 2 previous errors diff --git a/tests/ui/span/E0539.stderr b/tests/ui/span/E0539.stderr index 89f710156f3..34d81b73cb5 100644 --- a/tests/ui/span/E0539.stderr +++ b/tests/ui/span/E0539.stderr @@ -6,6 +6,7 @@ LL | #[inline(unknown)] | | | valid arguments are `always` or `never` | + = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/codegen.html#the-inline-attribute> help: try changing it to one of the following valid forms of the attribute | LL - #[inline(unknown)] 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)] |
