diff options
| author | David Tolnay <dtolnay@gmail.com> | 2018-12-01 16:20:58 -0800 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2018-12-01 16:21:02 -0800 |
| commit | 8b1f69a485d394f4439336f958451054c0e89184 (patch) | |
| tree | c55a9b6fc84cf53f393b4706772211b15af946b6 /tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.panic-abort.diff | |
| parent | c669727df4de8a9b155b4ebd389f56cc68fa3b30 (diff) | |
| download | rust-8b1f69a485d394f4439336f958451054c0e89184.tar.gz rust-8b1f69a485d394f4439336f958451054c0e89184.zip | |
Downgrade unsafe_vector_initialization to restriction
This lint looks for:
let mut vec = Vec::with_capacity(len);
vec.set_len(len);
The suggested replacement is `vec![0; len]`.
This is far too opinionated to be a deny-by-default lint because the performance
characteristics of the suggested replacement are totally different.
I am not convinced that this lint has value beyond what deny(unsafe_code) gives
you. Unsafe code is unsafe but please don't deny-by-default lint it if that's
the only reason.
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_bound.NormalizeArrayLen.panic-abort.diff')
0 files changed, 0 insertions, 0 deletions
