rust/tests/ui/async-await/async-closures/is-not-fn.rs
Esteban Küber 9ebbba4ad9 Shorten error message for callable with wrong return type
```
error: expected `{closure@...}` to return `Ret`, but it returns `Other`
```
instead of
```
error: expected `{closure@...}` to be a closure that returns `Ret`, but it returns `Other`
```
2025-02-02 01:00:33 +00:00

10 lines
295 B
Rust

//@ edition:2021
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
fn main() {
fn needs_fn(x: impl FnOnce()) {}
needs_fn(async || {});
//~^ ERROR expected `{async closure@is-not-fn.rs:8:14}` to return `()`
}