File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ // #91594: This used to ICE.
2+
3+ trait Component < M > {
4+ type Interface ;
5+ }
6+ trait HasComponent < I > { }
7+
8+ struct Foo ;
9+
10+ impl HasComponent < <Foo as Component < Foo > >:: Interface > for Foo { }
11+ //~^ ERROR the trait bound `Foo: HasComponent<()>` is not satisfied
12+
13+ impl < M : HasComponent < ( ) > > Component < M > for Foo {
14+ type Interface = u8 ;
15+ }
16+
17+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0277]: the trait bound `Foo: HasComponent<()>` is not satisfied
2+ --> $DIR/issue-91594.rs:10:6
3+ |
4+ LL | impl HasComponent<<Foo as Component<Foo>>::Interface> for Foo {}
5+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasComponent<()>` is not implemented for `Foo`
6+ |
7+ = help: the following implementations were found:
8+ <Foo as HasComponent<<Foo as Component<Foo>>::Interface>>
9+ note: required because of the requirements on the impl of `Component<Foo>` for `Foo`
10+ --> $DIR/issue-91594.rs:13:27
11+ |
12+ LL | impl<M: HasComponent<()>> Component<M> for Foo {
13+ | ^^^^^^^^^^^^ ^^^
14+
15+ error: aborting due to previous error
16+
17+ For more information about this error, try `rustc --explain E0277`.
You can’t perform that action at this time.
0 commit comments