rust/tests/ui/coverage-attr/name-value.stderr
Nicholas Nethercote ccb2194f96 Factor some code out of AstValidator::visit_items.
Currently it uses `walk_item` on some item kinds. For other item kinds
it visits the fields individually. For the latter group, this commit
adds `visit_attrs_vis` and `visit_attrs_vis_ident` which bundle up
visits to the fields that don't need special handling. This makes it
clearer that they haven't been forgotten about.

Also, it's better to do the attribute visits at the start because
attributes precede the items in the source code. Because of this, a
couple of tests have their output improved: errors appear in an order
that matches the source code order.
2025-04-02 09:16:34 +11:00

264 lines
6 KiB
Text

error: malformed `coverage` attribute input
--> $DIR/name-value.rs:12:1
|
LL | #[coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^
|
help: the following are the possible correct uses
|
LL - #[coverage = "off"]
LL + #[coverage(off)]
|
LL - #[coverage = "off"]
LL + #[coverage(on)]
|
error: malformed `coverage` attribute input
--> $DIR/name-value.rs:17:5
|
LL | #![coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^^
|
help: the following are the possible correct uses
|
LL - #![coverage = "off"]
LL + #![coverage(off)]
|
LL - #![coverage = "off"]
LL + #![coverage(on)]
|
error: malformed `coverage` attribute input
--> $DIR/name-value.rs:21:1
|
LL | #[coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^
|
help: the following are the possible correct uses
|
LL - #[coverage = "off"]
LL + #[coverage(off)]
|
LL - #[coverage = "off"]
LL + #[coverage(on)]
|
error: malformed `coverage` attribute input
--> $DIR/name-value.rs:26:1
|
LL | #[coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^
|
help: the following are the possible correct uses
|
LL - #[coverage = "off"]
LL + #[coverage(off)]
|
LL - #[coverage = "off"]
LL + #[coverage(on)]
|
error: malformed `coverage` attribute input
--> $DIR/name-value.rs:29:5
|
LL | #[coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^
|
help: the following are the possible correct uses
|
LL - #[coverage = "off"]
LL + #[coverage(off)]
|
LL - #[coverage = "off"]
LL + #[coverage(on)]
|
error: malformed `coverage` attribute input
--> $DIR/name-value.rs:35:1
|
LL | #[coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^
|
help: the following are the possible correct uses
|
LL - #[coverage = "off"]
LL + #[coverage(off)]
|
LL - #[coverage = "off"]
LL + #[coverage(on)]
|
error: malformed `coverage` attribute input
--> $DIR/name-value.rs:39:5
|
LL | #[coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^
|
help: the following are the possible correct uses
|
LL - #[coverage = "off"]
LL + #[coverage(off)]
|
LL - #[coverage = "off"]
LL + #[coverage(on)]
|
error: malformed `coverage` attribute input
--> $DIR/name-value.rs:44:5
|
LL | #[coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^
|
help: the following are the possible correct uses
|
LL - #[coverage = "off"]
LL + #[coverage(off)]
|
LL - #[coverage = "off"]
LL + #[coverage(on)]
|
error: malformed `coverage` attribute input
--> $DIR/name-value.rs:50:1
|
LL | #[coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^
|
help: the following are the possible correct uses
|
LL - #[coverage = "off"]
LL + #[coverage(off)]
|
LL - #[coverage = "off"]
LL + #[coverage(on)]
|
error: malformed `coverage` attribute input
--> $DIR/name-value.rs:53:5
|
LL | #[coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^
|
help: the following are the possible correct uses
|
LL - #[coverage = "off"]
LL + #[coverage(off)]
|
LL - #[coverage = "off"]
LL + #[coverage(on)]
|
error: malformed `coverage` attribute input
--> $DIR/name-value.rs:58:5
|
LL | #[coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^
|
help: the following are the possible correct uses
|
LL - #[coverage = "off"]
LL + #[coverage(off)]
|
LL - #[coverage = "off"]
LL + #[coverage(on)]
|
error: malformed `coverage` attribute input
--> $DIR/name-value.rs:64:1
|
LL | #[coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^
|
help: the following are the possible correct uses
|
LL - #[coverage = "off"]
LL + #[coverage(off)]
|
LL - #[coverage = "off"]
LL + #[coverage(on)]
|
error[E0788]: coverage attribute not allowed here
--> $DIR/name-value.rs:21:1
|
LL | #[coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^
...
LL | struct MyStruct;
| ---------------- not a function, impl block, or module
|
= help: coverage attribute can be applied to a function (with body), impl block, or module
error[E0788]: coverage attribute not allowed here
--> $DIR/name-value.rs:35:1
|
LL | #[coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^
...
LL | / trait MyTrait {
LL | | #[coverage = "off"]
... |
LL | | type T;
LL | | }
| |_- not a function, impl block, or module
|
= help: coverage attribute can be applied to a function (with body), impl block, or module
error[E0788]: coverage attribute not allowed here
--> $DIR/name-value.rs:39:5
|
LL | #[coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^
...
LL | const X: u32;
| ------------- not a function, impl block, or module
|
= help: coverage attribute can be applied to a function (with body), impl block, or module
error[E0788]: coverage attribute not allowed here
--> $DIR/name-value.rs:44:5
|
LL | #[coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^
...
LL | type T;
| ------- not a function, impl block, or module
|
= help: coverage attribute can be applied to a function (with body), impl block, or module
error[E0788]: coverage attribute not allowed here
--> $DIR/name-value.rs:29:5
|
LL | #[coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^
...
LL | const X: u32 = 7;
| ----------------- not a function, impl block, or module
|
= help: coverage attribute can be applied to a function (with body), impl block, or module
error[E0788]: coverage attribute not allowed here
--> $DIR/name-value.rs:53:5
|
LL | #[coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^
...
LL | const X: u32 = 8;
| ----------------- not a function, impl block, or module
|
= help: coverage attribute can be applied to a function (with body), impl block, or module
error[E0788]: coverage attribute not allowed here
--> $DIR/name-value.rs:58:5
|
LL | #[coverage = "off"]
| ^^^^^^^^^^^^^^^^^^^
...
LL | type T = ();
| ------------ not a function, impl block, or module
|
= help: coverage attribute can be applied to a function (with body), impl block, or module
error: aborting due to 19 previous errors
For more information about this error, try `rustc --explain E0788`.