about summary refs log tree commit diff
path: root/src/test/run-pass/thinlto
diff options
context:
space:
mode:
authorTommy Ip <hkmp7tommy@gmail.com>2017-06-05 11:14:48 +0100
committerTommy Ip <hkmp7tommy@gmail.com>2017-06-05 12:01:58 +0100
commit9d188e680e5558af2842231e6c32a676afc0086b (patch)
tree56cab4b094a50d37addcb7d3f3064da309c5bf43 /src/test/run-pass/thinlto
parentc94a9ac8ae33e6580940e02abb425dd2fe69b5d8 (diff)
downloadrust-9d188e680e5558af2842231e6c32a676afc0086b.tar.gz
rust-9d188e680e5558af2842231e6c32a676afc0086b.zip
Better closure error message
Use tracked data introduced in #42196 to provide a better closure
error message by showing why a closure implements `FnOnce`.

```
error[E0525]: expected a closure that implements the `Fn` trait, but
this closure only implements `FnOnce`
 --> $DIR/issue_26046.rs:4:19
  |
4 |       let closure = move || {
  |  ___________________^
5 | |         vec
6 | |     };
  | |_____^
  |
note: closure is `FnOnce` because it moves the variable `vec` out of
its environment
 --> $DIR/issue_26046.rs:5:9
  |
5 |         vec
  |         ^^^

error: aborting due to previous error(s)
```

Fixes #26046
Diffstat (limited to 'src/test/run-pass/thinlto')
0 files changed, 0 insertions, 0 deletions