Does not compile on 32-bit systems
jackpot51 opened this issue · 6 comments
error[E0599]: the method `view_bits_mut` exists for type `u64`, but its trait bounds were not satisfied
--> aml/src/value.rs:525:23
|
525 | value.view_bits_mut::<bitvec::order::Lsb0>()[0..length].clone_from_bitslice(bits);
| ^^^^^^^^^^^^^ method cannot be called on `u64` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`u64: BitStore`
which is required by `u64: BitView`
From BitStore in the docs:
BitStore is the simpler of the two parameters. It refers to the integer type
used to hold bits. It must be one of the Rust unsigned integer fundamentals:
u8, u16, u32, usize, and on 64-bit systems only, u64.
Hm, yeah weird. Not sure I understand why BitStore can't be implemented for u64 regardless of the platform's pointer size, but I must be missing something.
- We should definitely be testing a 32-bit platform on CI if you guys are interested in it compiling
- We need a different crate / workaround to handle the functionality
bitvecis doing for us but on 32-bit too
We definitely need to support 32 bit, i686 is one of Redox's supported architectures. It looks to me like the use of BitStore is just an optimization, although I did not confirm that. I was able to use conditional compilation to avoid the compilation error, (only use the bitvec optimization for fields of 32 bits or less when on x86) but I don't have a good way of testing that my implementation functions correctly.
Please prioritize this if you can, we are trying to port to v86 in-browser boot, and it requires a 32-bit executable.
Temporary hack is now merged and published as aml v0.16.3 - this will be fixed more elegantly in the future but hopefully this should allow you to move forward in the meantime.
Leaving this open to track.
I can confirm it is fixed, if you want to leave it open I will