Add test for old ICE in #91594
This commit is contained in:
parent
5b2747a3b9
commit
2819d9051c
2 changed files with 34 additions and 0 deletions
17
src/test/ui/traits/issue-91594.rs
Normal file
17
src/test/ui/traits/issue-91594.rs
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
// #91594: This used to ICE.
|
||||||
|
|
||||||
|
trait Component<M> {
|
||||||
|
type Interface;
|
||||||
|
}
|
||||||
|
trait HasComponent<I> {}
|
||||||
|
|
||||||
|
struct Foo;
|
||||||
|
|
||||||
|
impl HasComponent<<Foo as Component<Foo>>::Interface> for Foo {}
|
||||||
|
//~^ ERROR the trait bound `Foo: HasComponent<()>` is not satisfied
|
||||||
|
|
||||||
|
impl<M: HasComponent<()>> Component<M> for Foo {
|
||||||
|
type Interface = u8;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
17
src/test/ui/traits/issue-91594.stderr
Normal file
17
src/test/ui/traits/issue-91594.stderr
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
error[E0277]: the trait bound `Foo: HasComponent<()>` is not satisfied
|
||||||
|
--> $DIR/issue-91594.rs:10:6
|
||||||
|
|
|
||||||
|
LL | impl HasComponent<<Foo as Component<Foo>>::Interface> for Foo {}
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasComponent<()>` is not implemented for `Foo`
|
||||||
|
|
|
||||||
|
= help: the following implementations were found:
|
||||||
|
<Foo as HasComponent<<Foo as Component<Foo>>::Interface>>
|
||||||
|
note: required because of the requirements on the impl of `Component<Foo>` for `Foo`
|
||||||
|
--> $DIR/issue-91594.rs:13:27
|
||||||
|
|
|
||||||
|
LL | impl<M: HasComponent<()>> Component<M> for Foo {
|
||||||
|
| ^^^^^^^^^^^^ ^^^
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0277`.
|
Loading…
Add table
Reference in a new issue