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

serde compilation error #229

Closed
jaredallard opened this issue Aug 22, 2023 · 3 comments
Closed

serde compilation error #229

jaredallard opened this issue Aug 22, 2023 · 3 comments

Comments

@jaredallard
Copy link

Version: 4.4.1
rustc --version: rustc 1.71.1 (eb26296b5 2023-08-03)
cargo --version: cargo 1.71.1 (7f1d04c00 2023-07-29)

Hi! This crate is imported through another package I'm using. When attempting to compile my project, I'm getting the following:

$ cargo run
... snip ...
   Compiling oauth2 v4.4.1
error[E0507]: cannot move out of `*self` which is behind a shared reference
  --> /Users/jaredallard/.asdf/installs/rust/1.71.1/registry/src/index.crates.io-6f17d22bba15001f/oauth2-4.4.1/src/revocation.rs:57:37
   |
57 | #[derive(Clone, Debug, Deserialize, Serialize)]
   |                                     ^^^^^^^^^
   |                                     |
   |                                     data moved here
   |                                     move occurs because `unrecognized` has type `StandardRevocableToken`, 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
   |
57 | #[derive(Clone, Debug, Deserialize, &Serialize)]
   |                                     +

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

I'm not the most proficient with Rust (I'm still learning!) so it's possible this might be something wrong with my project. Please let me know if there is anything else I can include in my report or that I can do. Thank you!

@jaredallard
Copy link
Author

Seemed to be an issue with the version of serde_json in use. I was able to fix that by changing the versions. Sorry for the noise!

@ramosbugs
Copy link
Owner

Do you know which versions of serde/serde_json were giving you this issue? I wonder if the version range defined in this crate's Cargo.toml needs to be adjusted. I'm away on vacation at the moment, but I'll reopen the issue so that I'll remember to take another look later.

@ramosbugs ramosbugs reopened this Aug 22, 2023
@ramosbugs ramosbugs changed the title Unable to compile on Rust 1.71.1 serde compilation error Aug 22, 2023
@ramosbugs
Copy link
Owner

Looks like this was due to serde-rs/serde#2591, which was specific to serde 1.0.184 and not related to this crate's Cargo.toml dependencies.

@ramosbugs ramosbugs closed this as not planned Won't fix, can't repro, duplicate, stale Aug 27, 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

2 participants