forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#66388 - estebank:melt-ice, r=Centril
Do not ICE on recovery from unmet associated type bound obligation Fix rust-lang#66353. r? @Centril
- Loading branch information
Showing
3 changed files
with
35 additions
and
1 deletion.
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
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,15 @@ | ||
// #66353: ICE when trying to recover from incorrect associated type | ||
|
||
trait _Func<T> { | ||
fn func(_: Self); | ||
} | ||
|
||
trait _A { | ||
type AssocT; | ||
} | ||
|
||
fn main() { | ||
_Func::< <() as _A>::AssocT >::func(()); | ||
//~^ ERROR the trait bound `(): _A` is not satisfied | ||
//~| ERROR the trait bound `(): _Func<_>` is not satisfied | ||
} |
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,18 @@ | ||
error[E0277]: the trait bound `(): _A` is not satisfied | ||
--> $DIR/issue-66353.rs:12:14 | ||
| | ||
LL | _Func::< <() as _A>::AssocT >::func(()); | ||
| ^^^^^^^^^^^^^^^^^^ the trait `_A` is not implemented for `()` | ||
|
||
error[E0277]: the trait bound `(): _Func<_>` is not satisfied | ||
--> $DIR/issue-66353.rs:12:41 | ||
| | ||
LL | fn func(_: Self); | ||
| ----------------- required by `_Func::func` | ||
... | ||
LL | _Func::< <() as _A>::AssocT >::func(()); | ||
| ^^ the trait `_Func<_>` is not implemented for `()` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |