about summary refs log tree commit diff
path: root/src/test/run-pass/thinlto
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2016-10-27 19:02:27 -0700
committerEsteban Küber <esteban@kuber.com.ar>2016-11-19 17:17:02 -0800
commitec24442e60bce2605a64ac3aef5784510e4a5fd5 (patch)
tree28a579e94c392baf1a5e7fbd7155ca6985a10443 /src/test/run-pass/thinlto
parentfb025b483a5ef96bba944055c47af620d2afb602 (diff)
downloadrust-ec24442e60bce2605a64ac3aef5784510e4a5fd5.tar.gz
rust-ec24442e60bce2605a64ac3aef5784510e4a5fd5.zip
Provide hint when cast needs a dereference
For a given code:

```rust
vec![0.0].iter().map(|s| s as i16).collect::<Vec<i16>>();
```

display:

```nocode
error: casting `&f64` as `i16` is invalid
 --> foo.rs:2:35
  |
2 |     vec![0.0].iter().map(|s| s as i16).collect::<Vec<i16>>();
  |                              -    ^^^ cannot cast `&f64` as `i16`
  |                              |
  |                              did you mean `*s`?
```

instead of:

```nocode
error: casting `&f64` as `i16` is invalid
 --> <anon>:2:30
  |
2 |     vec![0.0].iter().map(|s| s as i16).collect();
  |                              ^^^^^^^^
  |
  = help: cast through a raw pointer first
```
Diffstat (limited to 'src/test/run-pass/thinlto')
0 files changed, 0 insertions, 0 deletions