Skip to content

Commit

Permalink
Add test for issue-70944
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Oct 17, 2020
1 parent 7db8904 commit 11a188a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/test/ui/traits/issue-70944.rs
@@ -0,0 +1,23 @@
// 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() {}

0 comments on commit 11a188a

Please sign in to comment.