diff options
Diffstat (limited to 'tests/ui/async-await/async-closures/async-fn-mut-impl-fn-once.rs')
| -rw-r--r-- | tests/ui/async-await/async-closures/async-fn-mut-impl-fn-once.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/async-await/async-closures/async-fn-mut-impl-fn-once.rs b/tests/ui/async-await/async-closures/async-fn-mut-impl-fn-once.rs new file mode 100644 index 00000000000..59d034953d7 --- /dev/null +++ b/tests/ui/async-await/async-closures/async-fn-mut-impl-fn-once.rs @@ -0,0 +1,15 @@ +//@ edition:2021 +//@ check-pass +//@ revisions: current next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver + +fn call_once<F>(_: impl FnOnce() -> F) {} + +fn main() { + let mut i = 0; + let c = async || { + i += 1; + }; + call_once(c); +} |
