diff options
| author | Michael Goulet <michael@errs.io> | 2025-05-21 18:07:29 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-05-21 20:02:29 +0000 |
| commit | e0f80558716372902b2eda1e43ab2e169bfb3669 (patch) | |
| tree | b034686bdb7f560b53ca1e59b299e159c41702e9 /tests/ui/async-await/async-closures/async-fn-mut-impl-fn-once.rs | |
| parent | ca912d794d42336ddd54389480b56bfc2bc6685f (diff) | |
| download | rust-e0f80558716372902b2eda1e43ab2e169bfb3669.tar.gz rust-e0f80558716372902b2eda1e43ab2e169bfb3669.zip | |
Fix FnOnce impl for AsyncFn/AsyncFnMut closures in new solver
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); +} |
