]> git.lizzy.rs Git - rust.git/blob - tests/ui/higher-rank-trait-bounds/normalize-under-binder/issue-81809.rs
Rollup merge of #106797 - FawazTirmizi:dev/issues/104284, r=bjorn3
[rust.git] / tests / ui / higher-rank-trait-bounds / normalize-under-binder / issue-81809.rs
1 // check-pass
2
3 pub trait Indexable {
4     type Idx;
5 }
6 impl Indexable for u8 {
7     type Idx = u8;
8 }
9 impl Indexable for u16 {
10     type Idx = u16;
11 }
12
13 pub trait Indexer<T: Indexable>: std::ops::Index<T::Idx, Output = T> {}
14
15 trait StoreIndex: Indexer<u8> + Indexer<u16> {}
16
17 fn foo(st: &impl StoreIndex) -> &dyn StoreIndex {
18     st as &dyn StoreIndex
19 }
20
21 fn main() {}