rust/tests/ui/async-await/async-closures/is-not-fn.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
408 B
Rust
Raw Permalink Normal View History

2024-01-25 17:43:35 +00:00
//@ edition:2021
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
2024-01-25 17:43:35 +00:00
fn main() {
fn needs_fn(x: impl FnOnce()) {}
needs_fn(async || {});
2025-04-22 23:31:22 +00:00
//[current]~^ ERROR expected `{async closure@is-not-fn.rs:8:14}` to return `()`
//[next]~^^ ERROR type mismatch resolving `{async closure body@$DIR/is-not-fn.rs:8:23: 8:25} == ()`
2024-01-25 17:43:35 +00:00
}