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

cargo_metadata 0.15.4 doesn't compile #247

Closed
danandreicarp opened this issue Aug 21, 2023 · 1 comment
Closed

cargo_metadata 0.15.4 doesn't compile #247

danandreicarp opened this issue Aug 21, 2023 · 1 comment

Comments

@danandreicarp
Copy link

Hello,

I'm trying to install cargo-tarpaulin on a mac, but the installation fails when attempting to compile cargo_metadata. This is the error I'm seeing:

 Compiling cargo_metadata v0.15.4
error[E0507]: cannot move out of `*self` which is behind a shared reference
  --> /workspace/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo_metadata-0.15.4/src/diagnostic.rs:95:24
   |
95 | #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
   |                        ^^^^^^^^^
   |                        |
   |                        data moved here
   |                        move occurs because `unrecognized` has type `Applicability`, which does not implement the `Copy` trait
   |
   = note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider borrowing here
   |
95 | #[derive(Debug, Clone, &Serialize, Deserialize, PartialEq, Eq, Hash)]
   |                        +

error[E0507]: cannot move out of `*self` which is behind a shared reference
   --> /workspace/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo_metadata-0.15.4/src/messages.rs:104:24
    |
104 | #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
    |                        ^^^^^^^^^
    |                        |
    |                        data moved here
    |                        move occurs because `unrecognized` has type `Message`, which does not implement the `Copy` trait
    |
    = note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider borrowing here
    |
104 | #[derive(Debug, Clone, &Serialize, Deserialize, PartialEq, Eq, Hash)]
    |                        +

For more information about this error, try `rustc --explain E0507`.
error: could not compile `cargo_metadata` (lib) due to 2 previous errors

Is this a known issue? Is there a workaround?

Thank you!

@dtolnay
Copy link

dtolnay commented Aug 21, 2023

This is a serde bug (serde-rs/serde#2591). A fix has been published so it should work now if you give it another try.

@oli-obk oli-obk closed this as completed Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants