forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for old ICE in rust-lang#91594
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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`. |