diff options
| author | Ryan Cumming <etaoins@gmail.com> | 2018-10-08 06:20:32 +1100 |
|---|---|---|
| committer | Ryan Cumming <etaoins@gmail.com> | 2018-10-08 06:20:32 +1100 |
| commit | 9bd4e5469e1ecb7d98602ba1d805872faa8bf2c9 (patch) | |
| tree | 3ff42b1514b6fa13ca2946fd475925b75c10d7fd /tests/mir-opt/lower_array_len.array_len_raw.NormalizeArrayLen.diff | |
| parent | 63ceabf0cf5758fa513b12b648608db7ff6f5166 (diff) | |
| download | rust-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
