Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with the new serde_derive system #567

Closed
neon64 opened this issue Sep 29, 2016 · 5 comments
Closed

Issues with the new serde_derive system #567

neon64 opened this issue Sep 29, 2016 · 5 comments
Assignees
Labels

Comments

@neon64
Copy link

neon64 commented Sep 29, 2016

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

@dtolnay
Copy link
Member

dtolnay commented Sep 29, 2016

Thanks for reporting these!

The first one is fixed in rust-lang/rust#36782 and will be in tomorrow's nightly.

The second one I filed as rust-lang/cargo#3132.

@dtolnay
Copy link
Member

dtolnay commented Sep 30, 2016

I confirmed that #![feature(structural_match, rustc_attrs)] are no longer necessary in rustc 1.14.0-nightly (289f3a4ca 2016-09-29).

The doc issue is in progress at rust-lang/rust#36847.

@neon64
Copy link
Author

neon64 commented Oct 1, 2016

Thanks very much by the way for the quick progress made on these two issues.

@dtolnay
Copy link
Member

dtolnay commented Oct 3, 2016

The rustdoc fix just merged. I will leave this ticket open until I can confirm that it works.

@dtolnay
Copy link
Member

dtolnay commented Oct 6, 2016

I confirmed that cargo doc works using rustc 1.14.0-nightly (9c31d76e9 2016-10-03).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants