Skip to content

Issues with the new serde_derive system #567

Closed
@neon64

Description

@neon64

When using that plugin, there are two errors:

error: the semantics of constant patterns is not yet settled (see issue #31434)
  --> src/state.rs:10:1
   |
10 | pub enum ArchiveEntryPerReplica {
   | ^
   |
   = help: add #![feature(structural_match)] to the crate attributes to enable

error: internal implementation detail (see issue #29642)
  --> src/state.rs:10:1
   |
10 | pub enum ArchiveEntryPerReplica {
   | ^
   |
   = help: add #![feature(rustc_attrs)] to the crate attributes to enable

Both of these are easily solvable by following the compiler's instructions. But I suppose my question is, why are these needed in the first place and should it be documented so that new users don't get tripped up?

Additionally if I run cargo doc then cargo tries to document the serde_derive crate and complains because it contains items with #[rustc_macro_derive].

error: the `#[rustc_macro_derive]` attribute is only usable with crates of the `rustc-macro` crate type
 --> /home/chris/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/serde_derive-0.8.10/src/lib.rs:9:3
  |
9 | #[rustc_macro_derive(Serialize)]
  |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: the `#[rustc_macro_derive]` attribute is only usable with crates of the `rustc-macro` crate type
  --> /home/chris/.cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/serde_derive-0.8.10/src/lib.rs:18:3
   |
18 | #[rustc_macro_derive(Deserialize)]
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I realise it is super early days for serde_derive but I thought I'd just point out these issues as from some quick searching I can't see any acknowledgement of them.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions