bitvec icon indicating copy to clipboard operation
bitvec copied to clipboard

crate doesnt compile on arduino

Open antonilol opened this issue 1 year ago • 1 comments

on this target, u8, u16, u32, u64 and usize all have an align of 1, usize is 2 bytes wide (like u16), so my project doesnt compile because i (transitively) depend on bitvec, which doesnt compile on this target

i get multiple errors like this one:

error[E0308]: mismatched types
   --> /home/antoni/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitvec-1.0.1/src/store.rs:126:7
    |
126 |                   = [(); mem::aligned_to_size::<Self>() as usize];
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an array with a fixed size of 1 element, found one with 0 elements
...
188 | / store! {
189 | |     u8 => BitSafeU8;
190 | |     u16 => BitSafeU16;
191 | |     u32 => BitSafeU32;
192 | | }
    | |_- in this macro invocation
    |
    = note: this error originates in the macro `store` (in Nightly builds, run with -Z macro-backtrace for more info)

somewhat related to #76

antonilol avatar May 03 '24 20:05 antonilol

i do find this a weird way to enforce layout compatibility as this gives no guarantees for unsafe code, but this should be the only code that relies on layout compatibility

antonilol avatar May 03 '24 20:05 antonilol