mozilla / cbindgen

A project for generating C bindings from Rust code
Mozilla Public License 2.0
2.27k stars 294 forks source link

derive-{eq,neq} doesn't account for #[cfg()]d fields. #937

Open emilio opened 3 months ago

emilio commented 3 months ago
/// The object allocated by an Arc<T>
#[repr(C)]
struct ArcInner<T: ?Sized> {
    count: atomic::AtomicUsize,
    #[cfg(feature = "track_alloc_size")]
    alloc_size: usize,
    data: T,
}

The derived eq/neq implementations still use alloc_size, without the necessary ifdef.