diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2024-03-15 18:08:12 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2024-04-11 16:41:42 +0000 |
| commit | 4ca876b7a43c52a51cfcaf865a29a3ff27059b26 (patch) | |
| tree | a670e05611ef5b9eb0ccc6db65cb637ef65a56ff /tests/rustdoc-js-std/parser-errors.js | |
| parent | dfe28debb914dc944bf8de270016071f6742098d (diff) | |
| download | rust-4ca876b7a43c52a51cfcaf865a29a3ff27059b26.tar.gz rust-4ca876b7a43c52a51cfcaf865a29a3ff27059b26.zip | |
Better account for `FnOnce` in move errors
```
error[E0382]: use of moved value: `blk`
--> $DIR/once-cant-call-twice-on-heap.rs:8:5
|
LL | fn foo<F:FnOnce()>(blk: F) {
| --- move occurs because `blk` has type `F`, which does not implement the `Copy` trait
LL | blk();
| ----- `blk` moved due to this call
LL | blk();
| ^^^ value used here after move
|
note: `FnOnce` closures can only be called once
--> $DIR/once-cant-call-twice-on-heap.rs:6:10
|
LL | fn foo<F:FnOnce()>(blk: F) {
| ^^^^^^^^ `F` is made to be an `FnOnce` closure here
LL | blk();
| ----- this value implements `FnOnce`, which causes it to be moved when called
```
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
0 files changed, 0 insertions, 0 deletions
