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
zerocopy-derive used to support struct fields with raw identifiers, like r#type, up to 0.8.12, but this was broken in 0.8.13. For example:
use zerocopy::byteorder::network_endian::U16;use zerocopy::{FromBytes,Immutable,IntoBytes,KnownLayout,Unaligned};#[repr(C)]#[derive(KnownLayout,FromBytes,IntoBytes,Immutable,Unaligned,Debug,PartialEq,Eq,Clone)]pubstructIcmpHeader{r#type:u8,code:u8,checksum:U16,id:U16,sequence:U16,}
This compiles successfully with this Cargo.toml:
[package]
name = "foo"version = "0.1.0"edition = "2021"
[dependencies]
zerocopy = { version = "=0.8.12", features = ["derive"] }
But fails with this Cargo.toml:
[package]
name = "foo"version = "0.1.0"edition = "2021"
[dependencies]
zerocopy = { version = "=0.8.13", features = ["derive"] }
with this error message:
% cargo build
Updating crates.io index
Compiling foo v0.1.0 (/usr/local/google/home/etryzelaar/foo)
error: proc-macro derive panicked
--> src/lib.rs:5:10
|
5 | #[derive(KnownLayout, FromBytes, IntoBytes, Immutable, Unaligned, Debug, PartialEq, Eq, Clone)]
| ^^^^^^^^^^^
|
= help: message: `"__Zerocopy_Field_r#type"` is not a valid identifier
The text was updated successfully, but these errors were encountered:
zerocopy-derive used to support struct fields with raw identifiers, like
r#type
, up to 0.8.12, but this was broken in 0.8.13. For example:This compiles successfully with this
Cargo.toml
:But fails with this
Cargo.toml
:with this error message:
The text was updated successfully, but these errors were encountered: