Skip to content

Commit a115a59

Browse files
committed
Add regression test for rust-lang#102206
Signed-off-by: Yuki Okushi <[email protected]>
1 parent 7f42e58 commit a115a59

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// edition:2021
2+
3+
async fn foo() {}
4+
5+
fn main() {
6+
std::mem::size_of_val(foo());
7+
//~^ ERROR: mismatched types
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/issue-102206.rs:6:27
3+
|
4+
LL | std::mem::size_of_val(foo());
5+
| --------------------- ^^^^^
6+
| | |
7+
| | expected reference, found opaque type
8+
| | help: consider borrowing here: `&foo()`
9+
| arguments to this function are incorrect
10+
|
11+
note: while checking the return type of the `async fn`
12+
--> $DIR/issue-102206.rs:3:16
13+
|
14+
LL | async fn foo() {}
15+
| ^ checked the `Output` of this `async fn`, found opaque type
16+
= note: expected reference `&_`
17+
found opaque type `impl Future<Output = ()>`
18+
note: function defined here
19+
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
20+
21+
error: aborting due to previous error
22+
23+
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)