#[macro_use]
extern crate serde_derive;
#[serde(untagged)]
enum CellIndex {
Auto,
Index(u32),
}
error[E0658]: The attribute `serde` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
--> src/main.rs:4:1
|
4 | #[serde(untagged)]
| ^^^^^^^^^^^^^^^^^^
|
= help: add #![feature(custom_attribute)] to the crate attributes to enable
The error and suggestion are super misleading and I have seen this a few times in #serde. It should be possible for the compiler to observe that there are derive macros in scope with serde declared as an attribute, and suggest using those.
// These are in scope
#[proc_macro_derive(Serialize, attributes(serde))]
#[proc_macro_derive(Deserialize, attributes(serde))]
A better message would not have the part about the compiler adding meaning to #[serde] in the future and would recommend using #[derive(Serialize)] or #[derive(Deserialize)] on the struct containing the attribute.
The error and suggestion are super misleading and I have seen this a few times in #serde. It should be possible for the compiler to observe that there are derive macros in scope with
serdedeclared as an attribute, and suggest using those.A better message would not have the part about the compiler adding meaning to
#[serde]in the future and would recommend using#[derive(Serialize)]or#[derive(Deserialize)]on the struct containing the attribute.