about summary refs log tree commit diff
path: root/tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff
diff options
context:
space:
mode:
authorRyan Cumming <etaoins@gmail.com>2018-10-08 06:20:32 +1100
committerRyan Cumming <etaoins@gmail.com>2018-10-08 06:20:32 +1100
commit9bd4e5469e1ecb7d98602ba1d805872faa8bf2c9 (patch)
tree3ff42b1514b6fa13ca2946fd475925b75c10d7fd /tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff
parent63ceabf0cf5758fa513b12b648608db7ff6f5166 (diff)
downloadrust-9bd4e5469e1ecb7d98602ba1d805872faa8bf2c9.tar.gz
rust-9bd4e5469e1ecb7d98602ba1d805872faa8bf2c9.zip
Don't suggest cloned() for map Box deref
Boxes are a bit magic in that they need to use `*` to get an owned value
out of the box. They implement `Deref` but that only returns a
reference. This means an easy way to convert an `Option<Box<T>>` to an
`<Option<T>` is:

```
box_option.map(|b| *b)
```

However, since b36bb0a6 the `map_clone` lint is detecting this as an
attempt to copy the box. Fix by excluding boxes completely from the
deref part of this lint.

Fixes #3274
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff')
0 files changed, 0 insertions, 0 deletions