Reported by @Hoverbear here: https://twitter.com/a_hoverbear/status/1428763621572501507
use serde::{Deserialize, Serialize};
#[derive(Serialize)]
struct A;
Output:
error: cannot find derive macro `Serialize` in this scope
--> src/main.rs:3:10
|
3 | #[derive(Serialize)]
| ^^^^^^^^^
warning: unused import: `serde::Serialize`
--> src/main.rs:1:5
|
1 | use serde::Serialize;
| ^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
The diagnostics shows that Serialize is not found, and then complains that Serialize was imported and unused. Confusing.
(Only the trait Serialize is imported, not the Serialize derive macro, as the derive feature wasn't enabled on serde.)
Reported by @Hoverbear here: https://twitter.com/a_hoverbear/status/1428763621572501507
Output:
The diagnostics shows that
Serializeis not found, and then complains thatSerializewas imported and unused. Confusing.(Only the trait
Serializeis imported, not theSerializederive macro, as thederivefeature wasn't enabled onserde.)