Files
rust/tests/ui/parser/attribute-on-empty.stderr
León Orell Valerian Liehr 3d5b7aaa01 Simplify recovery from outer attributes on generic args
Use our new routine. Again, this means we can now also recover from
leading doc comments and inner attributes.

Moreover, we now actually store type & const arguments that have outer
attributes in the AST instead of using `{type error}` & `{const error}`
for them, respectively.
2026-09-07 21:43:51 +02:00

71 lines
1.9 KiB
Plaintext

error: attributes cannot be applied to generic arguments
--> $DIR/attribute-on-empty.rs:6:16
|
LL | let _: Baz<#[cfg(false)]> = todo!();
| ^^^^^^^^^^^^^ attributes are not allowed here
error: attributes cannot be applied to types
--> $DIR/attribute-on-empty.rs:10:14
|
LL | fn g(_param: #[attr]) {}
| ^^^^^^^ attributes are not allowed here
error: expected type, found `)`
--> $DIR/attribute-on-empty.rs:10:21
|
LL | fn g(_param: #[attr]) {}
| ^ expected type
error: attributes cannot be applied to types
--> $DIR/attribute-on-empty.rs:15:15
|
LL | fn f() -> #[attr] { 0 }
| ^^^^^^^ attributes are not allowed here
error: expected type, found `{`
--> $DIR/attribute-on-empty.rs:15:23
|
LL | fn f() -> #[attr] { 0 }
| ^ expected type
error: attributes cannot be applied to types
--> $DIR/attribute-on-empty.rs:21:12
|
LL | field: #[attr],
| ^^^^^^^ attributes are not allowed here
error: expected type, found `,`
--> $DIR/attribute-on-empty.rs:21:19
|
LL | struct S {
| - while parsing this struct
LL | field: #[attr],
| ^ expected type
error: attributes cannot be applied to types
--> $DIR/attribute-on-empty.rs:27:19
|
LL | type Tuple = (#[attr], String);
| ^^^^^^^ attributes are not allowed here
error: expected type, found `,`
--> $DIR/attribute-on-empty.rs:27:26
|
LL | type Tuple = (#[attr], String);
| ^ expected type
error: attributes cannot be applied to types
--> $DIR/attribute-on-empty.rs:32:6
|
LL | impl #[attr] {}
| ^^^^^^^ attributes are not allowed here
error: expected type, found `{`
--> $DIR/attribute-on-empty.rs:32:14
|
LL | impl #[attr] {}
| ^ expected type
error: aborting due to 11 previous errors