-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not ICE on unmet trait alias bounds
- Loading branch information
Showing
3 changed files
with
41 additions
and
6 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
11 changes: 11 additions & 0 deletions
11
tests/ui/traits/alias/issue-108072-unmet-trait-alias-bound.rs
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,11 @@ | ||
// Regression test for #108072: do not ICE upon unmet trait alias constraint | ||
|
||
#![feature(trait_alias)] | ||
|
||
trait IteratorAlias = Iterator; | ||
|
||
fn f(_: impl IteratorAlias) {} | ||
|
||
fn main() { | ||
f(()) //~ `()` is not an iterator | ||
} |
19 changes: 19 additions & 0 deletions
19
tests/ui/traits/alias/issue-108072-unmet-trait-alias-bound.stderr
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,19 @@ | ||
error[E0277]: `()` is not an iterator | ||
--> $DIR/issue-108072-unmet-trait-alias-bound.rs:10:7 | ||
| | ||
LL | f(()) | ||
| - ^^ `()` is not an iterator | ||
| | | ||
| required by a bound introduced by this call | ||
| | ||
= help: the trait `Iterator` is not implemented for `()` | ||
= note: required for `()` to implement `IteratorAlias` | ||
note: required by a bound in `f` | ||
--> $DIR/issue-108072-unmet-trait-alias-bound.rs:7:14 | ||
| | ||
LL | fn f(_: impl IteratorAlias) {} | ||
| ^^^^^^^^^^^^^ required by this bound in `f` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |