Commit Graph

13555 Commits

Author SHA1 Message Date
Max Baumann
fd2c860171
feat: add comment 2022-03-18 14:45:48 +01:00
Max Baumann
3c4192f3e9
fix: ran update_lints 2022-03-18 01:12:39 +01:00
Max Baumann
05e05eaed7
refactor: rename lint to or_then_unwrap 2022-03-18 01:04:33 +01:00
Max Baumann
44c62c9aa2
feat: add tests and fix existing ones 2022-03-18 00:51:26 +01:00
Max Baumann
17ff85081d
feat: rename variable in example 2022-03-18 00:34:24 +01:00
Max Baumann
4493fc7d27
refactor: use pattern matching for MethodCall arguments
Co-authored-by: xFrednet <xFrednet@gmail.com>
2022-03-18 00:23:55 +01:00
Max Baumann
c22ff6cd6e
fix: fix clippy_lints 2022-03-17 19:52:07 +01:00
Max Baumann
747bb245e7
fix: fix broken dogfood tests 2022-03-17 19:29:59 +01:00
Max Baumann
3f00f074de
fix: fix tests 2022-03-17 19:13:44 +01:00
Max Baumann
f49a2c3457
feat: add use_unwrap_or 2022-03-17 18:57:28 +01:00
bors
65e5cd0e95 Auto merge of #8553 - Jarcho:transmute_undefined_8499, r=llogiq
Don't lint `transmute_undefined_repr` when changing the type of generic params

Partially fixes #8499

changelog: Don't lint `transmute_undefined_repr` when changing the type of generic params
2022-03-16 19:27:44 +00:00
Jason Newcomb
8e5208cbff Don't lint transmute_undefined_repr when changing the type of generic params 2022-03-16 12:56:23 -04:00
bors
d23ddab82d Auto merge of #8544 - nellorocca:dev/5757, r=flip1995
Moved ``[try_err]`` to restriction

Fixes #5757

changelog: Moved try_err lint to rescrition for #5757
2022-03-16 09:55:39 +00:00
bors
2b0e730bf3 Auto merge of #8547 - Jarcho:transmute_8501, r=flip1995
More `transmute_undefined_repr` fixes

fixes: #8498
fixes: #8501
fixes: #8503

changelog: Allow `transumte_undefined_repr` between fat pointers and `(usize, usize)`
changelog: Allow `transumte_undefined_repr` when one side is a union
changelog: Fix `transumte_undefined_repr` on tuples with one non-zero-sized type.
2022-03-16 09:39:22 +00:00
bors
d6a3fbf8da Auto merge of #8546 - KisaragiEffective:patch-1, r=llogiq
[`collapsible_if`] fix typo in code-block kind specifier

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: [`collapsible_if`] fix typo in code-block kind specifier
2022-03-16 06:20:45 +00:00
Jason Newcomb
47c9ed697b Fix checking transmutes with adjusted types 2022-03-15 23:11:11 -04:00
Jason Newcomb
911e10562a Don't lint transmute_undefined_repr on unions. 2022-03-15 22:38:15 -04:00
Jason Newcomb
7fd52b5e3c Small simplification to transmute_undefined_repr 2022-03-15 22:33:26 -04:00
Jason Newcomb
442d4ce1c3 Don't lint fat pointer to (usize, usize) conversion in transmute_undefined_repr 2022-03-15 22:31:07 -04:00
Jason Newcomb
e71ac41d44 Fix transmute_undefined_repr for single element tuples 2022-03-15 21:51:07 -04:00
Kisaragi
9f95e7622d
fix typo in code-block kind specifier 2022-03-16 10:19:19 +09:00
Kisaragi
fc5cbba1a4
fix typo in code-block kind specifier 2022-03-16 08:50:30 +09:00
Paolo Gentili
a39d649733 Lint list updated 2022-03-15 19:38:40 +01:00
Paolo Gentili
5c1843dbce Moved lint to restriction 2022-03-15 18:45:01 +01:00
bors
b83c6323c7 Auto merge of #8541 - flip1995:iter_with_drain_ambulance, r=giraffate
Move iter_with_drain to nursery

cc #8538 #8539

r? `@giraffate`

changelog: Move [`iter_with_drain`] to nursery
2022-03-15 09:02:38 +00:00
flip1995
b981748036
Move iter_with_drain to nursery 2022-03-15 09:46:49 +01:00
bors
71ecbc42f9 Auto merge of #8509 - smoelius:fix-8507, r=giraffate
Fix `unncessary_to_owned` false positive

Fix #8507

changelog: none
2022-03-15 01:08:47 +00:00
bors
9a1f6a9795 Auto merge of #8537 - xFrednet:7923-single-component-path-imports-for-macros, r=llogiq
Allow `single_component_path_imports` for all macros

Closes: https://github.com/rust-lang/rust-clippy/issues/7923

It can be useful to have `use macro_name` regardless of the visibility. This removes the visibility filter.

changelog: [`single_component_path_imports`]: no longer triggers on macros
2022-03-14 23:39:50 +00:00
bors
0e1311b70f Auto merge of #8536 - xFrednet:8062-applicability-search-is-some, r=camsteffen
Make `search_is_some`s suggestion `MachineApplicable`

My biggest PR to date, about 0.3 Lines have been changed!

Closes https://github.com/rust-lang/rust-clippy/issues/8062

The suggestion seems to work well, as we've received no error reports since the implementation in December. This PR therefore promotes the suggestion to `MachineApplicable`. The tests already include `.fixed` files :)

changelog: [`search_is_some`]: Make more suggestions `MachineApplicable`
2022-03-14 22:12:25 +00:00
xFrednet
2ee5372389
Allow single_component_path_imports for all macros 2022-03-14 22:45:00 +01:00
xFrednet
fc5540a4d3
Make search_is_somes suggestion MachineApplicable 2022-03-14 22:02:10 +01:00
bors
dc5423ad44 Auto merge of #8534 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2022-03-14 10:34:17 +00:00
flip1995
2ebd0b20b0
Bump nightly version -> 2022-03-14 2022-03-14 11:29:39 +01:00
flip1995
d5ab347d5c
Merge remote-tracking branch 'upstream/master' into rustup 2022-03-14 11:29:18 +01:00
bors
e2e492c10e Auto merge of #8422 - buttercrab:only_used_in_recursion, r=llogiq
new lint: `only_used_in_recursion`

changed:
- added `only_used_in_recursion`.
- fixed code that variables are only used in recursion.
- this would not lint when `unused_variable`

This fixes: #8390

-----

changelog: add lint [`only_used_in_recursion`]
2022-03-13 16:11:25 +00:00
Jaeyong Sung
800f66de2b
add clearing return vars 2022-03-14 00:13:57 +09:00
bors
75b616e92f Auto merge of #8471 - J-ZhengLi:master-issue7040, r=llogiq
new lint that detects useless match expression

fixes #7040

changelog: Add new  lint [`needless_match`] under complexity lint group
2022-03-13 14:49:56 +00:00
Nicholas Nethercote
e110231260 Improve AdtDef interning.
This commit makes `AdtDef` use `Interned`. Much the commit is tedious
changes to introduce getter functions. The interesting changes are in
`compiler/rustc_middle/src/ty/adt.rs`.
2022-03-11 13:31:24 +11:00
Jaeyong Sung
1ad7e7097a
remove parameters that are only used in recursion 2022-03-10 16:06:35 +09:00
Jaeyong Sung
52d35dca6a
fix build error 2022-03-10 15:53:53 +09:00
J-ZhengLi
086b045822 add checking for x -> x and ref x -> x and related test cases. 2022-03-10 14:46:58 +08:00
Jaeyong Sung
69161c6327
fix to lint Self::function 2022-03-10 15:46:40 +09:00
bors
8ae74da63b Auto merge of #8070 - CrazyRoka:update-gh-pages-checkbox-styles, r=camsteffen
Improve styles of filtering options for Clippy's lint list

Partially solves #7958

Updated styles for filtering options. It now uses dropdown menus.

![image](https://user-images.githubusercontent.com/19844144/144608479-cdd9de0b-f101-4d49-a135-0969efb01a11.png)

changelog: none
2022-03-10 03:08:34 +00:00
J-ZhengLi
ec9116412a rename lint to needless_match
and change its lint group to "complexity"
2022-03-10 09:44:25 +08:00
lcnr
a4d6c61bdc add #[rustc_pass_by_value] to more types 2022-03-08 15:39:52 +01:00
J-ZhengLi
750204e3e3 fix a bug that caused internal test fail 2022-03-08 18:15:11 +08:00
J-ZhengLi
6bfc1120cf add nop if-let expression check.
re-design test cases as some of them are not worth the effort to check.
2022-03-08 17:37:53 +08:00
bors
d3bc1297db Auto merge of #94706 - matthiaskrgr:rollup-l5erynr, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #93350 (libunwind: readd link attrs to _Unwind_Backtrace)
 - #93827 (Stabilize const_fn_fn_ptr_basics, const_fn_trait_bound, and const_impl_trait)
 - #94696 (Remove whitespaces and use CSS to align line numbers to the right instead)
 - #94700 (rustdoc: Update minifier version)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-03-07 18:06:31 +00:00
Eric Holk
43ce0a94af Update and fix clippy tests 2022-03-07 08:47:18 -08:00
Eric Holk
b86620da37 Stabilize const_fn_fn_ptr_basics and const_fn_trait_bound 2022-03-07 08:47:15 -08:00