about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/parser-errors.js
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-03-15 18:08:12 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-04-11 16:41:42 +0000
commit4ca876b7a43c52a51cfcaf865a29a3ff27059b26 (patch)
treea670e05611ef5b9eb0ccc6db65cb637ef65a56ff /tests/rustdoc-js-std/parser-errors.js
parentdfe28debb914dc944bf8de270016071f6742098d (diff)
downloadrust-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