Commit graph

9 commits

Author SHA1 Message Date
DevAccentor
5a70d88af5 add vec.capacity() to slow_vec_initialization 2022-06-05 11:01:54 +02:00
Jason Newcomb
7ed86bf822 Changes to ptr_arg
* Track the argument when used to initialize simple `let` bindings
* Check if the argument is passed to a function requiring the original type
* Use `multipart_suggestion` rather than multiple suggestions
* Check if the name given in the source code matches the name of the actual type
2022-01-12 20:57:50 -05:00
Philipp Hansch
38d4ac7cea
Remove all copyright license headers
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
2019-01-08 21:46:39 +01:00
Matthias Krüger
435299be30 rustfmt tests 2018-12-09 23:26:16 +01:00
David Tolnay
e632a1946e
Remove unsafe_vector_initialization lint 2018-12-03 02:48:37 -08:00
David Tolnay
67f9d24c1b
Keep testing unsafe_vector_initialization as ui test 2018-12-01 17:19:39 -08:00
Guillem Nieto
5fa04bc3cd Lint only the first statment/expression after alloc
Instead of searching for all the successive expressions after a vector
allocation, check only the first expression.

This is done to minimize the amount of false positives of the lint.
2018-11-25 14:34:23 -08:00
Guillem Nieto
9b4bc3b6ef Add unsafe set_len initialization 2018-11-25 14:34:23 -08:00
Guillem Nieto
e0ccc9d9af Add slow zero-filled vector initialization lint
Add lint to detect slow zero-filled vector initialization. It detects
when a vector is zero-filled with extended with `repeat(0).take(len)`
or `resize(len, 0)`.
This zero-fillings are usually slower than simply using `vec![0; len]`.
2018-11-25 14:34:23 -08:00