mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
13 lines
321 B
Rust
13 lines
321 B
Rust
#![feature(async_closure)]
|
|
|
|
//@ edition:2021
|
|
|
|
fn foo<X>(x: impl FnOnce() -> Box<X>) {}
|
|
// just to make sure async closures can still be suggested for boxing.
|
|
fn bar<X>(x: Box<dyn FnOnce() -> X>) {}
|
|
|
|
fn main() {
|
|
foo(async move || {}); //~ ERROR mismatched types
|
|
bar(async move || {}); //~ ERROR mismatched types
|
|
}
|