diff --git a/src/test/ui/traits/issue-91594.rs b/src/test/ui/traits/issue-91594.rs new file mode 100644 index 00000000000..930f7f0c6ad --- /dev/null +++ b/src/test/ui/traits/issue-91594.rs @@ -0,0 +1,17 @@ +// #91594: This used to ICE. + +trait Component { + type Interface; +} +trait HasComponent {} + +struct Foo; + +impl HasComponent<>::Interface> for Foo {} +//~^ ERROR the trait bound `Foo: HasComponent<()>` is not satisfied + +impl> Component for Foo { + type Interface = u8; +} + +fn main() {} diff --git a/src/test/ui/traits/issue-91594.stderr b/src/test/ui/traits/issue-91594.stderr new file mode 100644 index 00000000000..10298a0c703 --- /dev/null +++ b/src/test/ui/traits/issue-91594.stderr @@ -0,0 +1,17 @@ +error[E0277]: the trait bound `Foo: HasComponent<()>` is not satisfied + --> $DIR/issue-91594.rs:10:6 + | +LL | impl HasComponent<>::Interface> for Foo {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasComponent<()>` is not implemented for `Foo` + | + = help: the following implementations were found: + >::Interface>> +note: required because of the requirements on the impl of `Component` for `Foo` + --> $DIR/issue-91594.rs:13:27 + | +LL | impl> Component for Foo { + | ^^^^^^^^^^^^ ^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`.