Commit graph

12647 commits

Author SHA1 Message Date
Nathaniel Hamovitz
a54dbf6445 Improve doc and span messages 2021-10-18 03:52:57 -07:00
Nathaniel Hamovitz
a6aa9864a3 Rename stderr 2021-10-18 03:52:37 -07:00
Nathaniel Hamovitz
7f84e3d791 Rename lint 2021-10-18 03:45:08 -07:00
Nathaniel Hamovitz
149b372873 run rustfmt 2021-10-18 03:16:10 -07:00
Nathaniel Hamovitz
6377fb2fe7 Tidy import + update expected stderr 2021-10-18 03:13:48 -07:00
Nathaniel Hamovitz
cd6862283e Tidy imports 2021-10-18 03:05:19 -07:00
Nathaniel Hamovitz
9f402b370c Check for tuple structs 2021-10-18 03:05:19 -07:00
Nathaniel Hamovitz
2a5a4f07cf Refactor ZS array detection again and this one seems great 👍 2021-10-18 03:05:19 -07:00
Nathaniel Hamovitz
c5d3167a23 update testsuite and expand if_chain 2021-10-18 03:05:19 -07:00
Nathaniel Hamovitz
a3420f7004 Tidy comments + tests; revert 'size-is-zero' detection 2021-10-18 03:05:19 -07:00
Nathaniel Hamovitz
9b3f55ee61 tried to simplify but it doesn't work :/ 2021-10-18 03:05:19 -07:00
Nathaniel Hamovitz
5fdf93415b intermediate step 2021-10-18 03:05:19 -07:00
Nathaniel Hamovitz
003972f428 add multiple get_attrs and includes_repr and they all work! 2021-10-18 03:05:18 -07:00
Nathaniel Hamovitz
b9948c4be6 Ran dev bless! 2021-10-18 03:05:18 -07:00
Nathaniel Hamovitz
4b4db59772 output looks fantastic 2021-10-18 03:05:18 -07:00
Nathaniel Hamovitz
e53a4da4a1 it works i think (incl some dbgs) 2021-10-18 03:05:18 -07:00
Nathaniel Hamovitz
523b013161 Implement getting an array of attributes! 2021-10-18 03:05:18 -07:00
Nathaniel Hamovitz
7ee8e7a9b8 Implement detecting trailing zero-sized array 2021-10-18 03:05:18 -07:00
Nathaniel Hamovitz
92d3b775bd ayy it compiles! ship it, right? 😎 /s
why was `rustc_lint_defs` not already externed in `lib.rs`?
and how was r-a able to find it but cargo wasn't? 🤔
2021-10-18 03:05:18 -07:00
Nathaniel Hamovitz
c69387a0d5 Well it builds 2021-10-18 03:05:18 -07:00
Nathaniel Hamovitz
797507c583 Add boilerplate and basic tests 2021-10-18 03:05:18 -07:00
bors
389a74b31a Auto merge of #7835 - mikerite:unneeded-allow-20211018, r=xFrednet
Remove unneeded allow

Remove unneeded allow

changelog: none
2021-10-18 07:25:12 +00:00
Michael Wright
63d715209e Remove unneeded allow 2021-10-18 08:46:11 +02:00
Matthias Krüger
e84537bcdd Rollup merge of #89990 - petrochenkov:idempty, r=wesleywiser
rustc_span: `Ident::invalid` -> `Ident::empty`

The equivalent for `Symbol`s was renamed some time ago (`kw::Invalid` -> `kw::Empty`), and it makes sense to do the same thing for `Ident`s as well.
2021-10-18 08:13:30 +02:00
bors
af85240049 Auto merge of #7832 - narpfel:implicit-saturating-sub-false-positive-else, r=giraffate
Fix false positive of `implicit_saturating_sub` with `else` clause

Fixes #7831

changelog: Fix false positive of [`implicit_saturating_sub`] with `else` clause
2021-10-18 00:22:48 +00:00
Vadim Petrochenkov
5f2ecc37f8 rustc_span: Ident::invalid -> Ident::empty
The equivalent for `Symbol`s was renamed some time ago (`kw::Invalid` -> `kw::Empty`), and it makes sense to do the same thing for `Ident`s.
2021-10-17 23:20:30 +03:00
Dmitry Borodin
bdc1624259
Add reference to another doc with explanation
Add reference to another doc that explains which repository should be passed in this command since this is not covered in the command help itself.
2021-10-17 18:59:36 +02:00
Matthias Krüger
79b73ac98d Rollup merge of #89963 - r00ster91:parenthesisparentheses, r=nagisa
Some "parenthesis" and "parentheses" fixes

"Parenthesis" is the singular (e.g. one `(` or one `)`) and "parentheses" is the plural (multiple `(` or `)`s) and this is not hard to mix up so here are some fixes for that.

Inspired by #89958
2021-10-17 18:18:59 +02:00
Paul Gey
a550133b8f Fix false positive of implicit_saturating_sub with else clause
Fixes #7831
2021-10-17 15:56:59 +02:00
r00ster91
599d9126a2 Some "parenthesis" and "parentheses" fixes 2021-10-17 12:04:01 +02:00
bors
d50cfd26e5 Auto merge of #7827 - zvavybir:master, r=xFrednet
Fixed naive doc formatting for `#[must_use]` lints

The documentation of a few lints around the `#[must_use]` attribute had a few times "[`#[must_use]`]" (without the parentheses, but with the `[]`) and once the "`" was missing.

changelog: Fixed naive doc formatting for `#[must_use]` lints ([`must_use_unit`], [`double_must_use`], [`must_use_candidate`], [`let_underscore_must_use`])
2021-10-16 19:07:37 +00:00
Matthias Kaak
25ff7ce128 Fixed naive doc formatting for #[must_use] lints 2021-10-16 15:26:47 +00:00
bors
e1871ba0da Auto merge of #7743 - smoelius:master, r=camsteffen
Add `format_in_format_args` and `to_string_in_format_args` lints

Fixes #7667 and #7729

I put these in `perf` since that was one of `@jplatte's` suggestions, and `redundant_clone` (which I consider to be similar) lives there as well.

However, I am open to changing the category or anything else.

r? `@camsteffen`

changelog: Add `format_in_format_args` and `to_string_in_format_args` lints
2021-10-15 17:05:13 +00:00
Samuel E. Moelius III
75e9f8cbd6 Remove redundant to_strings 2021-10-15 12:44:49 -04:00
Samuel E. Moelius III
47014d81a1 Fix adjacent tests 2021-10-15 12:44:49 -04:00
Samuel E. Moelius III
c9599d79a3 Add format_in_format_args and to_string_in_format_args lints
Fixes #7667 and #7729
2021-10-15 12:44:38 -04:00
bors
db403bb889 Auto merge of #7823 - mikerite:match-overlapping-arm-20211015, r=xFrednet
Some small improvements to the `match_overlapping_arm` tests

changelog: none
2021-10-15 12:42:16 +00:00
bors
70f36e0454 Auto merge of #7824 - dswij:unnecessary_sort_by, r=llogiq
`unnecessary_sort_by` checks if argument implements `Ord` trait

closes #7822

changelog: [`unnecessary_sort_by`] now checks if argument implements `Ord` trait
2021-10-15 11:16:57 +00:00
dswij
e4ac4c2e1a Add test on unnecessary_sort_by when argument does not implement Ord 2021-10-15 18:12:47 +08:00
dswij
ec5071931e unnecessary_sort_by only warns if argument impl Ord trait 2021-10-15 18:10:55 +08:00
Cameron Steffen
0a23fff82d Fix clippy with changed macro statement spans 2021-10-15 02:36:58 -05:00
Michael Wright
28a249b53e Add unbounded pats to match_overlapping_arm tests 2021-10-15 06:25:11 +02:00
Michael Wright
e664a76add Refactor overlapping arm tests
Make the `println!`s match the patterns. Currently they are using the
deprecated syntax for inclusive ranges and extra spacing.
2021-10-15 06:20:28 +02:00
bors
4996e17b14 Auto merge of #7815 - nhamovitz:patch-1, r=giraffate
Fix typo in example for `match_result_ok`

changelog: Fix typo in example for ``[`match_result_ok`]``
2021-10-13 23:44:42 +00:00
bors
b9b11a96d2 Auto merge of #7805 - aDotInTheVoid:transmute-num-bits, r=camsteffen
Add lint transmute_num_to_bytes

Closes #7803

changelog: [`transmute_num_to_bytes`] new lint
2021-10-13 19:40:33 +00:00
nhamovitz
09aa4ad6dc
Fix typo in example for match_result_ok 2021-10-13 12:12:46 -07:00
Nixon Enraght-Moony
58969807ab Add lint transmute_num_to_bytes
Closes #7803

changelog: [`transmute_num_to_bytes`] new lint
2021-10-13 20:05:05 +01:00
bors
57dc0343bd Auto merge of #7788 - flip1995:eq_if_let_sugg, r=giraffate
Do not expand macros in equatable_if_let suggestion

Fixes #7781

Let's use Hacktoberfest as a motivation to start contributing PRs myself again :)

changelog: [`equatable_if_let`]: No longer expands macros in the suggestion
2021-10-13 12:04:57 +00:00
Oli Scherer
049ab82662 Update clippy ui output 2021-10-13 11:06:14 +00:00
bors
3d9c4a655b Auto merge of #7682 - Qwaz:uninit_vec, r=xFrednet
Implement uninit_vec lint

changelog: add the new lint [`uninit_vec`]

Fix #7681
2021-10-12 21:04:13 +00:00