Commit Graph

13192 Commits

Author SHA1 Message Date
Jason Newcomb
15c068ed0f Fix needless_borrow causing mutable borrows to be moved 2022-01-21 09:50:11 -05:00
bors
fff8e78f6d Auto merge of #8298 - ebobrow:op_ref_fp, r=giraffate
fix op_ref false positive

fixes #7572

changelog: `op_ref` don't lint for unnecessary reference in BinOp impl if removing the reference will lead to unconditional recursion
2022-01-18 00:12:42 +00:00
bors
8d14c94b5c Auto merge of #8292 - marekdownar:8239, r=xFrednet
issue #8239: Printed hint for lint or_fun_call is cropped and does no…

fixes rust-lang/rust-clippy#8239

changelog: [`or_fun_call`]: if suggestion contains more lines than MAX_SUGGESTION_HIGHLIGHT_LINES it is stripped to one line
2022-01-17 12:08:30 +00:00
bors
72c59fda27 Auto merge of #8302 - xFrednet:0000-move-return-self-not-must-use, r=flip1995
Move `return_self_not_must_use` to `pedantic`

r? `@flip1995`

changelog: none
2022-01-17 11:35:58 +00:00
xFrednet
2d3eb5082a
Move return_self_not_must_use to pedantic 2022-01-17 12:35:19 +01:00
Marek Downar
69d78ceeba
removing unsafe from test fn's && renaming shrink to sugg_span 2022-01-17 12:34:03 +01:00
bors
d364d8ad5b Auto merge of #8299 - marekdownar:8214, r=Manishearth
#8214 cmp_owned suggestion flips the comparison

changelog: ``[`cmp_owned`]`` fixes #8214 so that the suggestion does not flip the comparison
2022-01-17 07:04:06 +00:00
bors
537a7f3e44 Auto merge of #8297 - Jarcho:if_same_then_else_7579, r=Manishearth
Don't lint `if_same_then_else` with `if let` conditions

fixes #7579

changelog: Don't lint `if_same_then_else` with `if let` conditions
2022-01-17 06:48:01 +00:00
Jason Newcomb
5461ed670e Don't lint if_same_then_else with if let conditions 2022-01-16 18:39:46 -05:00
bors
93cad4a94d Auto merge of #8203 - pmnoxx:piotr-next-lint, r=llogiq
New lint: `iter_overeager_cloned`

Closes #8202

changelog: New lint: [`iter_overeager_cloned`]
2022-01-16 20:02:28 +00:00
Marek Downar
5b6ec8c57d
#8214 cmp_owned suggestion flips the comparison 2022-01-16 20:27:00 +01:00
Piotr Mikulski
36396c6b97 Fix tests 2022-01-16 10:33:30 -08:00
Piotr Mikulski
d48d247309 Fix clippy warnings 2022-01-16 10:19:48 -08:00
Piotr Mikulski
1c9b31d350 New line: cloned_next 2022-01-16 09:59:29 -08:00
Elliot Bobrow
fb5f51d3eb fix op_ref false positive 2022-01-16 09:20:33 -08:00
bors
0d27bd846c Auto merge of #8295 - Jarcho:useless_format_8290, r=giraffate
Handle implicit named arguments in `useless_format`

fixes #8290

Ideally this would fix the macro parsing code to handle this, but this is a smaller change and easier to back port.

changelog: Handle implicit named arguments in `useless_format`
2022-01-16 13:24:08 +00:00
bors
d61f798aac Auto merge of #8284 - xFrednet:0000-update-copyright-year-i-am-procrastinating, r=giraffate
Update copyright year for Clippy (2022 edition)

At this point, I'm just searching for small things to do instead of sleeping or working on my bachelor thesis. 😅  Taking one day off will be fine 🙃

changelog: none
2022-01-16 12:33:08 +00:00
bors
27845a9205 Auto merge of #8274 - andrewarchi:master, r=camsteffen
Update markdown-it version

Fixes improperly-escaped pipes in Markdown tables for the [documentation of bad_bit_mask](https://rust-lang.github.io/rust-clippy/master/index.html#bad_bit_mask) and [ineffective_bit_mask](https://rust-lang.github.io/rust-clippy/master/index.html#ineffective_bit_mask). A column pipe takes precedence over inline code markers, so some back ticks are displayed literally and the pipes need to be escaped. I found no other occurrences of the same problem when searching rust-clippy by ```\|.*`.*\|```.

changelog: Update markdown-it version
2022-01-15 22:17:37 +00:00
Jason Newcomb
cb384ff03b Handle implicit named arguments in useless_format 2022-01-15 16:28:49 -05:00
Marek Downar
49502727e7
issue #8239: fix to prev commit && 4 test cases 2022-01-15 22:19:01 +01:00
Marek Downar
ee84ac3396
issue #8239: Printed hint for lint or_fun_call is cropped and does not show the solution 2022-01-15 15:51:46 +01:00
bors
496f26c229 Auto merge of #8287 - Jarcho:iter_not_returning_iterator_8285, r=Manishearth
Erase late bound regions in `iter_not_returning_iterator`

fixes #8285

changelog: None
2022-01-15 05:31:46 +00:00
Jason Newcomb
70a6d7b012 Erase late bound regions in iter_not_returning_iterator 2022-01-15 00:15:25 -05:00
xFrednet
4119801884
Update copyright year for Clippy (2022 edition) 2022-01-15 01:22:00 +01:00
bors
7a4acf9fa6 Auto merge of #8231 - Jarcho:implicit_clone_8227, r=camsteffen
Fix `implicit_clone` for `&&T`

fixes #8227

changelog: Don't lint `implicit_clone` on `&&T`
2022-01-14 22:17:29 +00:00
Andrew Archibald
65c072d7e6 Update markdown-it version 2022-01-13 20:01:56 -07:00
Andrew Archibald
adc3e669fa Escape pipes in Markdown tables 2022-01-13 13:20:30 -07:00
bors
5cada57f30 Auto merge of #8273 - SeeSpring:apply_not_unsafe_ptr_arg_deref_to_type_aliases, r=llogiq
Apply `not_unsafe_ptr_arg_deref` to type aliases

changelog: Apply [`not_unsafe_ptr_arg_deref`] to type aliases
2022-01-13 18:51:19 +00:00
SeeSpring
875b240083 Apply not_unsafe_ptr_arg_deref to type aliases 2022-01-13 09:47:56 -05:00
bors
97a5daa659 Auto merge of #8272 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2022-01-13 11:55:36 +00:00
flip1995
6ad05bcbbe
Bump nightly version -> 2022-01-13 2022-01-13 12:48:17 +01:00
flip1995
8a2141bae4
Bump Clippy Version -> 0.1.60 2022-01-13 12:48:08 +01:00
flip1995
11be495bde
Merge remote-tracking branch 'upstream/master' into rustup 2022-01-13 12:47:48 +01:00
bors
60e68d68c6 Auto merge of #8226 - Jarcho:manual_memcpy_8160, r=flip1995
`manual_memcpy` fix

fixes #8160

Ideally this would work with `VecDeque`, but the current interface is unsuitable for it. At a minimum something like `range_as_slices` would be needed.

changelog: Don't lint `manual_memcpy` on `VecDeque`
changelog: Suggest `copy_from_slice` for `manual_memcpy` when applicable
2022-01-12 18:44:34 +00:00
Jason Newcomb
ad95279c34 Suggest deref when needed in implicit_clone 2022-01-12 13:03:38 -05:00
Jason Newcomb
062db10c12 Add manual_memcpy_test for VecDeque 2022-01-12 12:33:47 -05:00
bors
5479024250 Auto merge of #8266 - camsteffen:test-tweaks, r=flip1995
Some test code cleanup

changelog: none

Mainly moves /clippy_workspace_tests into /tests and combines the two dogfood tests which can't run concurrently.
2022-01-12 17:19:58 +00:00
bors
133b3668bb Auto merge of #8265 - camsteffen:which-rustfmt, r=xFrednet
Cache rustfmt path

changelog: none

Call `rustup which rustfmt` and use the output. This shaves off  ~0.7 seconds for `cargo dev fmt` for me.
2022-01-12 17:03:52 +00:00
Cameron Steffen
90bf72c2cd Only run dogfood on linux in CI 2022-01-12 11:00:26 -06:00
bors
6f33f690ea Auto merge of #8112 - Alexendoo:disallowed_methods_primitives, r=flip1995
Allow primitive types in disallowed_methods

Fixes #8079

changelog: `disallowed_methods`: Now can disallow methods of primitive types
2022-01-12 16:47:45 +00:00
Alex Macleod
04eb27aeaf Use method name from conf::DisallowedMethod
Since def_path_str returns e.g. "core::f32::<impl f32>::clamp" for
"f32::clamp"
2022-01-12 16:23:22 +00:00
bors
7c82ae1c12 Auto merge of #8213 - paolobarbolini:size-of-as-bits, r=flip1995
Add `manual_bits` lint

Closes #6670

---

changelog: new lint: [`manual_bits`]
2022-01-12 16:21:14 +00:00
Alex Macleod
91581f6d5e Resolve primitive impls in clippy_utils::path_to_res 2022-01-12 16:20:23 +00:00
Paolo Barbolini
166737f3cb Add manual_bits lint 2022-01-12 16:46:57 +01:00
bors
b9cae79d7f Auto merge of #8037 - ojeda:doc-codegen-change, r=camsteffen
`README`: document that Clippy may change codegen

Currently, Clippy does not guarantee the same codegen will be produced.
Therefore, it should not be used as an universal replacement for `rustc`.

See https://github.com/rust-lang/rust-clippy/issues/8035.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

fixes #8035
changelog: document that Clippy may change codegen
2022-01-12 15:11:08 +00:00
bors
ae01c4ab3c Auto merge of #8190 - camsteffen:no-in-band-liftetimes, r=flip1995
Stop using `in_band_lifetimes`

Per rust-lang/rust#91867

changelog: none
2022-01-12 14:25:11 +00:00
bors
0d94167a23 Auto merge of #8198 - camsteffen:no-method-call-macro, r=flip1995
Remove method_call! macro

This is possible now that `SymbolStr` is removed from rustc.

changelog: none
2022-01-12 13:59:12 +00:00
bors
37e9985e86 Auto merge of #8268 - Jarcho:deref_addrof_8247, r=flip1995
Fix `deref_addrof`

fixes #8247

This would supersede #8259

changelog: Don't lint `deref_addrof` when the dereference and the borrow occur in different contexts
2022-01-12 13:25:58 +00:00
Jason Newcomb
d32277d78e Don't lint deref_addrof when the two operations occur in different expansions 2022-01-12 00:25:42 -05:00
bors
88f5be2041 Auto merge of #8262 - 1nF0rmed:chore-update-borrowed-box-doc, r=camsteffen
Improve documentation for `borrowed-box` lint

fixes #8161

Updates documentation to elaborate more on how removing Box from a function parameter can generalize the function.

changelog: none
2022-01-11 17:07:50 +00:00