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
use speedy::{Readable,Writable};#[derive(Readable,Writable)]structWrap<T>(Vec<T>);
with:
error[E0277]: the trait bound `T: Readable<'a_, C_>` is not satisfied
--> common/src/lib.rs:8:10
|
8 | #[derive(Readable, Writable)]
| ^^^^^^^^ the trait `Readable<'a_, C_>` is not implemented for `T`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting type parameter `T`
|
8 | #[derive(Readable, T: Readable<'a_, C_>, Writable)]
| ^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the trait bound `T: Writable<C_>` is not satisfied
--> common/src/lib.rs:8:20
|
8 | #[derive(Readable, Writable)]
| ^^^^^^^^ the trait `Writable<C_>` is not implemented for `T`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting type parameter `T`
|
8 | #[derive(Readable, Writable, T: Writable<C_>)]
| ^^^^^^^^^^^^^^^^^
This example fails:
with:
The expanded code looks fine, I think this is a Rust issue. rust-lang/rust#20671 and rust-lang/rust#44491 look relevant.
I've worked around this by manually impling these traits. A nicer solution might be enabling a
bound
attribute, akin to serde's?The text was updated successfully, but these errors were encountered: