#unfulfilled bounds, that are trivially true

8 messages · Page 1 of 1 (latest)

spice basin
#

what?????

ICache has bound that is literally IoMMU<Self>: sealed::FFISealed

HUH

error[E0277]: the trait bound `T: ICacheImpl` is not satisfied
  --> io-mmu/src/icache.rs:74:10
   |
74 |         <IoMMU<T> as sealed::FFISealed>::make_ffi(self)
   |          ^^^^^^^^ the trait `ICacheImpl` is not implemented for `T`
   |
note: required for `IoMMU<T>` to implement `FFISealed`
  --> io-mmu/src/icache.rs:33:29
   |
33 | impl<T: Sized + ICacheImpl> sealed::FFISealed for IoMMU<T> {
   |                 ----------  ^^^^^^^^^^^^^^^^^     ^^^^^^^^
   |                 |
   |                 unsatisfied trait bound introduced here
help: consider further restricting type parameter `T` with trait `ICacheImpl`
   |
64 | impl<T: ?Sized + ICache + icache::ICacheImpl> AsFFI for IoMMU<T> {
   |                         ++++++++++++++++++++
tribal monolith
#

only some trait bounds on traits are implied

#

and pub trait ICache where IoMMU<Self>: sealed::FFISealed { is not one of them

#

so having the bound T: ICache does not imply the bound IoMMU<T>: FFISealed

#

the kind of trait bounds that are implied is those which have Self on the left hand side, which is also the kind that can be written with supertrait syntax

#

so if you wrote

pub trait ICache where Self: sealed::FFISealed {

or the equivalent

pub trait ICache: sealed::FFISealed {

then the impl AsFFI for IoMMU<T> would get that implied bound, but as it is, it doesn't, because IoMMU<Self> is not Self

spice basin
#

Mhm well I just removed the bound from ICache entirely and then moved it to AsFFI haha