fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0308]: mismatched types 2 --> $DIR/issue-111011.rs:10:23 3 | 4LL | foo(async move || {}); 5 | ^^ expected `Box<_>`, found `async` closure body 6 | 7 = note: expected struct `Box<_>` 8 found `async` closure body `[async closure body@$DIR/issue-111011.rs:10:23: 10:25]` 9 = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html 10 11error[E0308]: mismatched types 12 --> $DIR/issue-111011.rs:11:9 13 | 14LL | bar(async move || {}); 15 | --- ^^^^^^^^^^^^^^^^ expected `Box<dyn FnOnce() -> _>`, found closure 16 | | 17 | arguments to this function are incorrect 18 | 19 = note: expected struct `Box<(dyn FnOnce() -> _ + 'static)>` 20 found closure `{closure@$DIR/issue-111011.rs:11:9: 11:22}` 21 = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html 22note: function defined here 23 --> $DIR/issue-111011.rs:7:4 24 | 25LL | fn bar<X>(x: Box<dyn FnOnce() -> X>) {} 26 | ^^^ ------------------------- 27help: store this in the heap by calling `Box::new` 28 | 29LL | bar(Box::new(async move || {})); 30 | +++++++++ + 31 32error: aborting due to 2 previous errors 33 34For more information about this error, try `rustc --explain E0308`.