Closed
Description
The error `derive` may only be applied to structs, enums and unions
currently fires for each derived trait in the attribute pointing at the trait it is implementing. It should instead fire once per attribute, pointing at the derive
.
Minimal Code
#![allow(dead_code)]
#![derive(Debug, PartialEq, Eq)]
struct DerivedOn;
fn main() {}
Output
Compiling playground v0.0.1 (file:///playground)
error: `derive` may only be applied to structs, enums and unions
--> src/main.rs:3:29
|
3 | #![derive(Debug, PartialEq, Eq)]
| ^^
error: `derive` may only be applied to structs, enums and unions
--> src/main.rs:3:18
|
3 | #![derive(Debug, PartialEq, Eq)]
| ^^^^^^^^^
error: `derive` may only be applied to structs, enums and unions
--> src/main.rs:3:11
|
3 | #![derive(Debug, PartialEq, Eq)]
| ^^^^^
error: aborting due to 3 previous errors
error: Could not compile `playground`.
To learn more, run the command again with --verbose.
Expected Output
Compiling playground v0.0.1 (file:///playground)
error: `derive` may only be applied to structs, enums and unions
--> src/main.rs:3:29
|
3 | #![derive(Debug, PartialEq, Eq)]
| ^^^^^^
error: aborting due to 1 previous error
error: Could not compile `playground`.
To learn more, run the command again with --verbose.