Skip to content

Commit

Permalink
unit test for issue 57673.
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkfelix committed Jan 22, 2019
1 parent 2dea8ec commit 33c2ceb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/test/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.rs
@@ -0,0 +1,7 @@
//extern crate has_assoc_type;

//fn ice(x: Box<dyn has_assoc_type::Foo<Assoc=()>>) {
fn ice(x: Box<dyn Iterator<Item=()>>) {
*x //~ ERROR mismatched types [E0308]
}
fn main() {}
14 changes: 14 additions & 0 deletions src/test/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr
@@ -0,0 +1,14 @@
error[E0308]: mismatched types
--> $DIR/issue-57673-ice-on-deref-of-boxed-trait.rs:5:5
|
LL | fn ice(x: Box<dyn Iterator<Item=()>>) {
| - possibly return type missing here?
LL | *x //~ ERROR mismatched types [E0308]
| ^^ expected (), found trait std::iter::Iterator
|
= note: expected type `()`
found type `(dyn std::iter::Iterator<Item=()> + 'static)`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.

0 comments on commit 33c2ceb

Please sign in to comment.