-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I don't know, off the top of my head, what attribute macros are available on the playground, so I'll use the crate I'm maintaining. The details of it are pretty much irrelevant anyway.
Given the following code:
#[derive(Copy, Clone)]
#[enumflags2::bitflags]
#[repr(u8)]
enum Foo {
A = 1,
}
fn main() {}
The current output is:
error[E0658]: macro attributes in `#[derive]` output are unstable
--> src/main.rs:2:3
|
2 | #[enumflags2::bitflags]
| ^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #81119 <https://github.com/rust-lang/rust/issues/81119> for more information
= help: add `#![feature(macro_attributes_in_derive_output)]` to the crate attributes to enable
A few versions back (I've tested 1.41.1), we were outputting the following, much more legible error:
error: macro attributes must be placed before `#[derive]`
--> src/main.rs:2:1
|
2 | #[enumflags2::bitflags]
| ^^^^^^^^^^^^^^^^^^^^^^^
This is motivated by meithecatte/enumflags2#37 — it took me a moment to understand what was happening when a user reported that error.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.