You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which gives an identical error message other than that it shows the longer source code.
Checking magnitude v0.1.0 (/home/lily/dev/magnitude)
error[E0107]: missing generics for struct `Magnitude`
--> src/static_precision/mod.rs:3:12
|
3 | pub struct Magnitude<const BYTES: usize>([u8; BYTES]);
| ^^^^^^^^^ expected 1 generic argument
|
note: struct defined here, with 1 generic parameter: `BYTES`
--> src/static_precision/mod.rs:3:12
|
3 | pub struct Magnitude<const BYTES: usize>([u8; BYTES]);
| ^^^^^^^^^ ------------------
help: add missing generic argument
|
3 | pub struct Magnitude<BYTES><const BYTES: usize>([u8; BYTES]);
| +++++++
For more information about this error, try `rustc --explain E0107`.
error: could not compile `magnitude` (lib) due to 3 previous errors
Considering how inane the suggestion from rustc is, I suspect this may actually be a compiler bug, but I want to get a second opinion before I go opening an issue claiming a compiler error, especially for code involving macros I didn't write.
The text was updated successfully, but these errors were encountered:
This isn't a compiler bug, the ByteEq derive macro doesn't currently emit generics on the PartialEq and Eq impls (which it probably should, or should emit an error that it doesn't support generics).
Opened a PR to allow deriving ByteEq and ByteHash for types with generics.
Note that ByteEq and ByteHash require the type implement NoUninit, which cannot currently be derived for generic structs, and must be manually verified to be correct and implemented.
Right off the bat, here's the minimum reproducible example:
Cargo.toml:
The bug still occurs identically if swapping out
bytemuck::ByteEq
forbytemuck::ByteHash
.The error from
cargo check
is:Following it's inane suggestion, unsurprisingly, does not fix the issue.
I got this from the rather more reasonable code:
Which gives an identical error message other than that it shows the longer source code.
Considering how inane the suggestion from rustc is, I suspect this may actually be a compiler bug, but I want to get a second opinion before I go opening an issue claiming a compiler error, especially for code involving macros I didn't write.
The text was updated successfully, but these errors were encountered: