Jason Newcomb
048297b5b2
ptr_arg
cleanup
2022-01-21 09:43:41 -05: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
bors
dbe167daaa
Auto merge of #7890 - Alexendoo:ptr-arg-alias, r=camsteffen
...
Ignore references to type aliases in ptr_arg
Works using the fact that the hir path will point to a TyAlias, rather than being resolved to the underlying type
Fixes #7699
changelog: [`ptr_arg`] No longer lints references to type aliases
2021-10-29 19:45:26 +00:00
Cameron Steffen
d8fcfd7d64
Move if_then_panic to pedantic
2021-10-28 09:38:01 -05:00
Alex Macleod
e2c30f05c1
Ignore references to type aliases in ptr_arg
...
Works using the fact that the hir path will point to a TyAlias, rather
than being resolved to the underlying type
2021-10-27 19:08:42 +01:00
Labelray
543b638dbe
Add new lint if_then_panic
2021-09-24 22:14:20 +08:00
David Tolnay
c2783c1dcb
Downgrade many_single_char_names to pedantic
2021-09-14 09:59:06 -07:00
Aleksei Latyshev
203715aa4e
don't ignore expression after first not matched method call in PtrCloneVisitor
2020-12-28 01:09:04 +03:00
Aleksei Latyshev
dfaea9c967
lint &PathBuf instead of &Path in PTR_ARG
...
- extract get_only_generic_arg_snippet to improve readability
2020-12-25 15:06:34 +03:00
Eduardo Broto
a1824e187c
ptr_arg: honor allow
attr on arguments
2020-05-25 23:09:06 +02:00
Shotaro Yamada
555f5a49a2
Test fixes
2019-10-03 08:10:29 +09: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
Oliver Scherer
b8654eaa6c
Stabilize tool lints
2018-10-11 12:16:22 +02:00
Manish Goregaokar
e9c025ea70
Add license header to Rust files
2018-10-06 09:43:08 -07:00
Josh Mcguigan
0f6d422817
Added test case for ptr_arg
2018-09-05 05:59:07 -07:00
flip1995
1b6f6051a8
Adapt ui-tests to the tool_lints
2018-08-29 11:08:29 -07:00
Michael Wright
2fd671e4bd
Move ref cow tests
...
This commit moves the ref cow tests from needless_borrow.rs to ptr_arg.rs
where all the other PTR_ARG tests are.
2018-04-05 18:13:39 +02:00
Oliver Schneider
50ffaca4c9
Reduce the hackiness of cargo-clippy
2017-10-03 12:07:24 +02:00
Andre Bogus
1e0268fda8
avoid linting ptr_arg
if .capacity()
is called. Also suggest removing .as_str()
where applicable.
...
THis fixes #2070 .
Also fixes a few formatting mishaps
2017-09-20 23:59:23 +02:00
Andre Bogus
72be166756
add suggestions for .clone() in ptr_arg fns
2017-09-16 09:10:26 +02:00
Oliver Schneider
74c776585c
Move all our tests back to ui tests
2017-08-01 17:54:21 +02:00
Oliver Schneider
4465bc3e3f
Make most tests an example
so we can run them one by one
2017-05-17 14:19:44 +02:00
Oliver Schneider
1f2c97a291
remove all //~ from tests
2017-02-08 14:58:07 +01:00
Oliver Schneider
fd1351f6e3
rustup and compile-fail -> ui test move
2017-02-07 21:05:30 +01:00