tim-harding / soa-rs

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

Compile error from `soa-rs-derive`: can't leak private type #6

Closed zaneduffield closed 7 months ago

zaneduffield commented 7 months ago

Using version 0.3.1 of soa-rs I cannot compile anything because a private type is being leaked from soa-rs-derive.

For me, to reproduce the issue it's as simple as

cargo init test_soa_rs;
cd test_soa_rs;
cargo add soa-rs;
cargo check;

I get the following error message

   Compiling soa-rs-derive v0.3.1
error[E0446]: private type `SoaDerive` in public interface
  --> C:\Users\zane\.cargo\registry\src\index.crates.io-6f17d22bba15001f\soa-rs-derive-0.3.1\src\fields.rs:9:1
   |
9  | / pub fn fields_struct(
10 | |     ident: Ident,
11 | |     vis: Visibility,
12 | |     fields: Punctuated<Field, Comma>,
13 | |     kind: FieldKind,
14 | |     soa_derive: SoaDerive,
15 | | ) -> Result<TokenStream, syn::Error> {
   | |____________________________________^ can't leak private type
   |
  ::: C:\Users\zane\.cargo\registry\src\index.crates.io-6f17d22bba15001f\soa-rs-derive-0.3.1\src\lib.rs:75:1
   |
75 |   struct SoaDerive {
   |   ---------------- `SoaDerive` declared as private

For more information about this error, try `rustc --explain E0446`.
error: could not compile `soa-rs-derive` (lib) due to previous error
zaneduffield commented 7 months ago

I upgraded to Rust 1.76 from 1.74 and I no longer have the issue.