Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crate doesnt compile on arduino #265

Open
antonilol opened this issue May 3, 2024 · 1 comment
Open

crate doesnt compile on arduino #265

antonilol opened this issue May 3, 2024 · 1 comment

Comments

@antonilol
Copy link

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
Copy link
Author

antonilol commented May 3, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant