mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 12:44:40 +00:00
24 lines
423 B
Rust
24 lines
423 B
Rust
|
//@ check-pass
|
||
|
// Regression test of #70944, should compile fine.
|
||
|
|
||
|
use std::ops::Index;
|
||
|
|
||
|
pub struct KeyA;
|
||
|
pub struct KeyB;
|
||
|
pub struct KeyC;
|
||
|
|
||
|
pub trait Foo: Index<KeyA> + Index<KeyB> + Index<KeyC> {}
|
||
|
pub trait FooBuilder {
|
||
|
type Inner: Foo;
|
||
|
fn inner(&self) -> &Self::Inner;
|
||
|
}
|
||
|
|
||
|
pub fn do_stuff(foo: &impl FooBuilder) {
|
||
|
let inner = foo.inner();
|
||
|
&inner[KeyA];
|
||
|
&inner[KeyB];
|
||
|
&inner[KeyC];
|
||
|
}
|
||
|
|
||
|
fn main() {}
|