Conversation
92c0188 to
6948538
Compare
|
Hey @joshlf. We rely on static assertions in some of our crates and were considering enabling error[E0277]: the trait bound `NotZerocopy: FromBytes` is not satisfied
--> zerocopy-derive/tests/trivial_bounds.rs:60:18
|
60 | assert_impl_all!(FromBytes1: FromBytes);
| ^^^^^^^^^^ the trait `FromBytes` is not implemented for `NotZerocopy`
|
= help: the following other types implement trait `FromBytes`:
isize
i8
i16
i32
i64
i128
usize
u8
and 38 others
note: required for `FromBytes1` to implement `FromBytes`
--> zerocopy-derive/tests/trivial_bounds.rs:55:10
|
55 | #[derive(FromBytes, FromZeroes)]
| ^^^^^^^^^ unsatisfied trait bound introduced in this `derive` macro
note: required by a bound in `_::{closure#0}::assert_impl_all`
--> zerocopy-derive/tests/trivial_bounds.rs:60:1
|
60 | assert_impl_all!(FromBytes1: FromBytes);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `assert_impl_all`
= note: this error originates in the derive macro `FromBytes` which comes from the expansion of the macro `assert_impl_all` (in Nightly builds, run with -Z macro-backtrace for more info)Amusingly, in the nightly 5 days later (2023-10-26 instead of 2023-10-21), all the errors are shown as expected. Presumably some change fixed the error ordering or something. Is the zerocopy crate still interested in adding |
|
Huh fascinating! I'll have to resurrect this PR and try again. Yes, we're still interested in |
DO NOT MERGE: We need to debug this issue.
The nightly
trivial_boundscauses some derive-emitted code to compile which is designed to fail compilation. This commit adds a test that ensures that the emitted code still triggers some compiler errors.Affects #61
Closes #500