Skip to content

Commit 71eedb3

Browse files
committed
Add test for old ICE in rust-lang#91594
1 parent 81bf978 commit 71eedb3

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

src/test/ui/traits/issue-91594.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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() {}

src/test/ui/traits/issue-91594.stderr

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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`.

0 commit comments

Comments
 (0)