Skip to content

Commit 33c2ceb

Browse files
committed
unit test for issue 57673.
1 parent 2dea8ec commit 33c2ceb

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//extern crate has_assoc_type;
2+
3+
//fn ice(x: Box<dyn has_assoc_type::Foo<Assoc=()>>) {
4+
fn ice(x: Box<dyn Iterator<Item=()>>) {
5+
*x //~ ERROR mismatched types [E0308]
6+
}
7+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/issue-57673-ice-on-deref-of-boxed-trait.rs:5:5
3+
|
4+
LL | fn ice(x: Box<dyn Iterator<Item=()>>) {
5+
| - possibly return type missing here?
6+
LL | *x //~ ERROR mismatched types [E0308]
7+
| ^^ expected (), found trait std::iter::Iterator
8+
|
9+
= note: expected type `()`
10+
found type `(dyn std::iter::Iterator<Item=()> + 'static)`
11+
12+
error: aborting due to previous error
13+
14+
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)