modular-bitfield
modular-bitfield copied to clipboard
#[bitfield] on empty struct causes compilation error
Some other macros may produce empty structs. Thus, having a #[bitfield]
above an empty struct should not be considered as error. So, let's look to the next code:
#[bitfield]
struct Foo {
}
And next error:
error[E0080]: evaluation of constant value failed
--> src/main.rs:4:1
|
4 | struct Foo {
| ^^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow