diff options
| author | Tommy Ip <hkmp7tommy@gmail.com> | 2017-06-05 11:14:48 +0100 |
|---|---|---|
| committer | Tommy Ip <hkmp7tommy@gmail.com> | 2017-06-05 12:01:58 +0100 |
| commit | 9d188e680e5558af2842231e6c32a676afc0086b (patch) | |
| tree | 56cab4b094a50d37addcb7d3f3064da309c5bf43 /src/test/run-pass/thinlto | |
| parent | c94a9ac8ae33e6580940e02abb425dd2fe69b5d8 (diff) | |
| download | rust-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
