Closed
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.