You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Serde 1.0.172 introduces a compilation failure issue when compiling on stable-x86_64-unknown-linux-gnu toolchain, but compiles successfully on stable-aarch64-apple-darwin toolchain. Same code compiles correctly on both toolchains when serde depencency set to 1.0.171.
Serde dependency in Cargo.toml is: serde = { version = "=1.0.172", default-features = false, features = ["derive"] }
Code failing is similar to:
#[derive(Clone, Copy, Debug, Eq, Deserialize, PartialEq, Serialize)]
#[serde(transparent)]
pub struct MyStruct...
This is then used in another struct that also derives Deserialize and Serialize, and that code fails compilation on the Linux system. (Note this fails on a local test machine, and on a GitHub Actions container.)
Compilation reports (3 times for Deserialize, on the same line; once for Serialize at the original declaration):
error[E0277]: the trait bound MyStruct: Deserialize<'_> is not satisfied
--> my_usage.rs:134:24
|
134 | pub system_status: MyStruct,
| ^^^^^^^^^^^^^^^^^ the trait Deserialize<'_> is not implemented for MyStruct
error[E0277]: the trait bound SystemStatusFlags: Serialize is not satisfied
--> my_struct.rs:129:48
|
129 | #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
| ^^^^^^^^^ the trait Serialize is not implemented for MyStruct
The text was updated successfully, but these errors were encountered:
I was able to reproduce this using the SystemStatusFlags definition you shared by email. Sorry about the breakage! I have published a fix in serde_derive 1.0.173.
// [dependencies]// bitflags = { version = "2", features = ["serde"] }// serde = { version = "1", default-features = false, features = ["derive"] }use bitflags::bitflags;use serde::{Serialize,Deserialize};bitflags!{
#[derive(Clone,Copy,Debug,Eq,Deserialize,PartialEq,Serialize)]
#[serde(transparent)]pubstructSystemStatusFlags:u32{constNO_ISSUES = 0x0000_0000;// ...}}
Serde 1.0.172 introduces a compilation failure issue when compiling on stable-x86_64-unknown-linux-gnu toolchain, but compiles successfully on stable-aarch64-apple-darwin toolchain. Same code compiles correctly on both toolchains when serde depencency set to 1.0.171.
Serde dependency in Cargo.toml is: serde = { version = "=1.0.172", default-features = false, features = ["derive"] }
Code failing is similar to:
#[derive(Clone, Copy, Debug, Eq, Deserialize, PartialEq, Serialize)]
#[serde(transparent)]
pub struct MyStruct...
This is then used in another struct that also derives Deserialize and Serialize, and that code fails compilation on the Linux system. (Note this fails on a local test machine, and on a GitHub Actions container.)
Compilation reports (3 times for Deserialize, on the same line; once for Serialize at the original declaration):
error[E0277]: the trait bound
MyStruct: Deserialize<'_>
is not satisfied--> my_usage.rs:134:24
|
134 | pub system_status: MyStruct,
| ^^^^^^^^^^^^^^^^^ the trait
Deserialize<'_>
is not implemented forMyStruct
error[E0277]: the trait bound
SystemStatusFlags: Serialize
is not satisfied--> my_struct.rs:129:48
|
129 | #[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
| ^^^^^^^^^ the trait
Serialize
is not implemented forMyStruct
The text was updated successfully, but these errors were encountered: