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
Traits such as QueueStateT have many methods which take a generic M: GuestMemory type parameter, and expect a &M argument. However, due to how implicit trait bounds work in Rust, those M: GuestMemory are actually M: GuestMemory + Sized, even if M doesn't actually have to be Sized to pass a reference to it. Callers of these methods have to propagate the Sized bound to any type parameters they have standing for M, which makes things unnecessarily restrictive overall. Fix this by explicitly adding a + ?Sized negative bound where applicable for the M generic type parameter of queue traits.
The text was updated successfully, but these errors were encountered:
This commit also introduces a relaxation of the trait bound on the
generic type parameter `M` for `QueueStateT::avail_idx` (i.e. it no
longer has to be `Sized`, as it was implicitly the case before). This
change reduces the number of trait bounds that have to be explicitly
propagated to the newly introduced methods. We should apply a similar
update to the rest of the interface as well (tracked by rust-vmm#152).
Signed-off-by: Alexandru Agache <[email protected]>
This commit also introduces a relaxation of the trait bound on the
generic type parameter `M` for `QueueStateT::avail_idx` (i.e. it no
longer has to be `Sized`, as it was implicitly the case before). This
change reduces the number of trait bounds that have to be explicitly
propagated to the newly introduced methods. We should apply a similar
update to the rest of the interface as well (tracked by rust-vmm#152).
Signed-off-by: Alexandru Agache <[email protected]>
This commit also introduces a relaxation of the trait bound on the
generic type parameter `M` for `QueueStateT::avail_idx` (i.e. it no
longer has to be `Sized`, as it was implicitly the case before). This
change reduces the number of trait bounds that have to be explicitly
propagated to the newly introduced methods. We should apply a similar
update to the rest of the interface as well (tracked by #152).
Signed-off-by: Alexandru Agache <[email protected]>
Traits such as
QueueStateT
have many methods which take a genericM: GuestMemory
type parameter, and expect a&M
argument. However, due to how implicit trait bounds work in Rust, thoseM: GuestMemory
are actuallyM: GuestMemory + Sized
, even ifM
doesn't actually have to beSized
to pass a reference to it. Callers of these methods have to propagate theSized
bound to any type parameters they have standing forM
, which makes things unnecessarily restrictive overall. Fix this by explicitly adding a+ ?Sized
negative bound where applicable for theM
generic type parameter of queue traits.The text was updated successfully, but these errors were encountered: