tim-harding / soa-rs

An SoA library for Rust
MIT License
113 stars 2 forks source link

Compile Error when deriving Soars #15

Closed BloodStainedCrow closed 2 months ago

BloodStainedCrow commented 2 months ago

I am using soa-rs = "0.7.1" and soa-rs-derive = "0.6.0". When I apply the derive macro to a struct:

#[derive(Debug, Soars)]
pub struct Test {
    a: i32,
}

I get the following compile Error:

error[E0053]: method `from_parts` has an incompatible type for trait
  --> src/producer.rs:19:17
   |
19 | #[derive(Debug, Soars)]
   |                 ^^^^^ expected `std::ptr::NonNull<u8>`, found `*mut u8`
   |
   = note: expected signature `unsafe fn(std::ptr::NonNull<u8>, _) -> producer::TestSoaRaw`
              found signature `unsafe fn(*mut u8, _) -> producer::TestSoaRaw`
   = note: this error originates in the derive macro `Soars` (in Nightly builds, run with -Z macro-backtrace for more info)
tim-harding commented 2 months ago

Thank you for letting me know. I updated soa-rs recently and forgot that I needed to separately publish an update to the derive crate. I just published 0.7.2 that depends on the updated derive crate.