-
-
Notifications
You must be signed in to change notification settings - Fork 845
Closed
Labels
Description
The following code doesn't compile on 1.23:
#[macro_use]
extern crate serde_derive;
extern crate serde;
#[serde(untagged)]
enum CellIndex {
Auto,
Index(u32),
}
The error message is:
error: The attribute `serde` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
--> src/lib.rs:20:1
|
20 | #[serde(untagged)]
| ^^^^^^^^^^^^^^^^^^
When you add #[derive(Serialize, Deserialize)]
to the enum, it compiles, but the error message was quite confusing. It sent me on a feature-flag-enabling goose hunt, and it took someone who knew what they were doing (h/t @dtolnay) to set me straight. A better error message would be great!
AndrewKvalheim