File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
compiler/rustc_next_trait_solver/src/solve/assembly
tests/ui/async-await/async-closures Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -327,7 +327,7 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_callable<I: Intern
327
327
// always be called once. It additionally implements `Fn`/`FnMut`
328
328
// only if it has no upvars referencing the closure-env lifetime,
329
329
// and if the closure kind permits it.
330
- if closure_kind != ty:: ClosureKind :: FnOnce && args. has_self_borrows ( ) {
330
+ if goal_kind != ty:: ClosureKind :: FnOnce && args. has_self_borrows ( ) {
331
331
return Err ( NoSolution ) ;
332
332
}
333
333
Original file line number Diff line number Diff line change
1
+ //@ edition:2021
2
+ //@ check-pass
3
+ //@ revisions: current next
4
+ //@ ignore-compare-mode-next-solver (explicit revisions)
5
+ //@[next] compile-flags: -Znext-solver
6
+
7
+ fn call_once < F > ( _: impl FnOnce ( ) -> F ) { }
8
+
9
+ fn main ( ) {
10
+ let mut i = 0 ;
11
+ let c = async || {
12
+ i += 1 ;
13
+ } ;
14
+ call_once ( c) ;
15
+ }
You can’t perform that action at this time.
0 commit comments