Samuel Moelius
ed519ad746
Improve possible_borrower
2022-12-20 05:12:13 -05:00
Alex Macleod
461e219d1d
Allow using clippy::msrv
as an outer attribute
2022-11-27 12:43:17 +00:00
Samuel Moelius
50f63a0f24
Address issues 9739 and 9782
2022-11-04 11:19:45 +00:00
Samuel Moelius
037f698147
needless_borrow
uses used_exactly_once
2022-10-07 05:07:44 -04:00
Samuel E. Moelius III
a05cb74d30
Enhance needless_borrow
to consider trait implementations
2022-08-16 18:34:51 -04:00
Evan Typanski
40340745a8
Use parens around [needless_borrow
] field calls
2022-07-19 15:17:24 -04:00
Jason Newcomb
6d21b79be9
Fix needless_borrow
suggestion when calling a trait method taking self
2022-06-28 12:48:27 -04:00
Jason Newcomb
a187d6412b
Merge different parent walking loops in dereference.rs
...
`needless_borrow` will now walk further to find the target type.
2022-06-28 12:48:26 -04:00
xFrednet
a613460e8a
Fix #[expect]
for needless_borrow
, ref_binding_to_ref
2022-06-06 11:51:36 +02:00
Jason Newcomb
a135b52102
Don't lint needless_borrow
in method receiver positions
2022-02-16 23:14:39 -05:00
Jason Newcomb
c61514086d
Subsume ref_in_deref
into needless_borrow
2022-01-22 21:22:33 -05:00
Jason Newcomb
9e9110e4f3
Remove final reference on fields and method calls in needless_borrow
2022-01-22 20:35:32 -05:00
Jason Newcomb
15c068ed0f
Fix needless_borrow
causing mutable borrows to be moved
2022-01-21 09:50:11 -05:00
Jason Newcomb
8ded385ddc
Improve needless_borrow
lint.
...
* Lint when a borrow is auto dereferenced more than once
* Lint when the expression is used as the expression of a block for a match arm
Moves `needless_borrow` and `ref_binding_to_reference` to `dereference`
lint pass in preperation for `explicit_auto_deref` lint.
2021-11-15 13:17:59 -05:00
dswij
81d57de791
Update needless_borrow
test output and expected fix
2021-09-13 12:29:24 +08:00
Jason Newcomb
6d4dc35882
Improve needless_borrow
lint
...
Suggest changing usages of ref bindings to match the new type
Split out some cases into new lint `ref_binding_to_reference`
2021-05-20 09:03:47 -04:00
Matthias Krüger
cd2a62cb0c
needless_borrow: print the type in the lint message
...
changelog: needless_borrow: print type in lint message
2020-12-13 15:29:18 +01:00
David Tolnay
94154cad20
Downgrade trivially_copy_pass_by_ref to pedantic
2020-04-02 18:56:10 -07:00
Manish Goregaokar
622b167eb8
needless_borrow: allow other lints, make fixable
2019-09-25 14:45:18 -07: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
flip1995
d2dbd0b8a5
Update *.stderr files
2018-12-28 12:41:12 +01:00
Matthias Krüger
7bcc2cd9c8
update test stderr
2018-12-10 08:22:07 +01:00
Manish Goregaokar
e9c025ea70
Add license header to Rust files
2018-10-06 09:43:08 -07:00
flip1995
e9af09c274
Adapt the *.stderr files of the 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
bootandy
e3c13da830
Change recomendation to: &[type] from Cow<type>
2018-03-03 12:25:20 -05:00
bootandy
9a002e52e5
Lint passing Cow by reference
...
Add lint for reference to Cow to the same place in the code where
lint for reference to String lives.
https://github.com/rust-lang-nursery/rust-clippy/issues/2405
2018-02-28 10:24:10 -05:00
Oliver Schneider
4f21b5b112
Update changed ui tests
2018-01-17 14:44:40 +01:00
Oliver Schneider
50ffaca4c9
Reduce the hackiness of cargo-clippy
2017-10-03 12:07:24 +02:00
topecongiro
d8afe2ccbc
Update tests
2017-09-16 11:27:46 +09:00
Oliver Schneider
c3ef220bba
Rebase and update ui test
2017-08-21 14:22:41 +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
866239b1a8
Add a test showing a false positive on needless_borrow
2017-05-05 14:26:14 +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