// check-pass pub trait Indexable { type Idx; } impl Indexable for u8 { type Idx = u8; } impl Indexable for u16 { type Idx = u16; } pub trait Indexer: std::ops::Index {} trait StoreIndex: Indexer + Indexer {} fn foo(st: &impl StoreIndex) -> &dyn StoreIndex { st as &dyn StoreIndex } fn main() {}