fix: break inside async closure has incorrect span for enclosing closure
This commit is contained in:
parent
a330e49593
commit
05b7b46e65
4 changed files with 22 additions and 12 deletions
|
@ -20,15 +20,16 @@ LL | fn needs_async_fn(_: impl async Fn()) {}
|
|||
| ^^^^^^^^^^ required by this bound in `needs_async_fn`
|
||||
|
||||
error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
|
||||
--> $DIR/wrong-fn-kind.rs:9:29
|
||||
--> $DIR/wrong-fn-kind.rs:9:20
|
||||
|
|
||||
LL | fn needs_async_fn(_: impl async Fn()) {}
|
||||
| --------------- change this to accept `FnMut` instead of `Fn`
|
||||
...
|
||||
LL | needs_async_fn(async || {
|
||||
| _____--------------_--------_^
|
||||
| | | |
|
||||
| | | in this closure
|
||||
| -------------- ^-------
|
||||
| | |
|
||||
| _____|______________in this closure
|
||||
| | |
|
||||
| | expects `Fn` instead of `FnMut`
|
||||
LL | |
|
||||
LL | | x += 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue