File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
src/test/ui/async-await/issues Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 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 number Diff line number Diff line change 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`.
You can’t perform that action at this time.
0 commit comments