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

1.0.184 might be causing a compilation error. #2591

Closed
tacogips opened this issue Aug 21, 2023 · 3 comments · Fixed by #2592
Closed

1.0.184 might be causing a compilation error. #2591

tacogips opened this issue Aug 21, 2023 · 3 comments · Fixed by #2592

Comments

@tacogips
Copy link

tacogips commented Aug 21, 2023

I got a compilation error which doesn't occur with serde 1.0.183. Is it a some breaking change?

example project

Cargo.toml

[package]
name = "serde_184_error"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
sentry = "0.31.5"

#The compile error not occured on serde = "= 1.0.183"
serde = "1.0.184"

Error message

    Updating crates.io index
    Checking sentry-types v0.31.5
error[E0507]: cannot move out of `*self` which is behind a shared reference
    --> /g/cargo/registry/src/index.crates.io-6f17d22bba15001f/sentry-types-0.31.5/src/protocol/v7.rs:1083:10
     |
1083 | #[derive(Serialize, Deserialize, Debug, Clone, Parti...
     |          ^^^^^^^^^
     |          |
     |          data moved here
     |          move occurs because `unrecognized` has type `v7::Context`, 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 moreinfo)
help: consider borrowing here
     |
1083 | #[derive(&Serialize, Deserialize, Debug, Clone, PartialEq)]
     |          +

For more information about this error, try `rustc --explain E0507`.
error: could not compile `sentry-types` (lib) due to previouserror
@dtolnay
Copy link
Member

dtolnay commented Aug 21, 2023

Indeed, this was a bug in #2570. I've published serde_derive 1.0.185 with a fix. Sorry about the breakage!

@ryanbinnsrv
Copy link

@dtolnay I was wondering why my CI builds started failing. Thanks for the quick fix! 🍺

@tacogips
Copy link
Author

@dtolnay Thank you for the excellent job as always. In fact, on my team, we refer to you as "dtolnay Sensei" with respect :)

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

Successfully merging a pull request may close this issue.

3 participants