Commit Graph

3152 Commits

Author SHA1 Message Date
Michael Wright
eb9caf3050 literal representation restructure 11
Rename `grouping_hint` to `format` and use the term consistently.
2019-11-13 08:28:06 +02:00
Michael Wright
a8ca8a21c1 literal representation restructure 10
Rename DigitInfo to NumericLiteral
2019-11-13 08:28:01 +02:00
Michael Wright
a9c5a599e3 literal representation restructure 9
Only store valid suffixes (and not mistyped suffixes) in DigitInfo.
Check for mistyped suffixes later and not when DigitInfo is created.
This opens the door to more sophisticated mistyped suffix checks later.
2019-11-13 08:27:54 +02:00
Michael Wright
a58b980bd8 literal representation restructure 8
Store the digit parts directly in DigitInfo since we need them anyway.
2019-11-13 08:27:49 +02:00
Michael Wright
b62543f756 literal representation restructure 7
Replace `do_lint` with `get_group_size`. Return `None` if there are no
groups.
2019-11-13 08:27:42 +02:00
Michael Wright
abf62d8011 literal representation restructure 6
Add `group_digits` helper function.
2019-11-13 08:27:37 +02:00
Michael Wright
ec664e84bf literal representation restructure 5
Use `split_digit_parts` in `check_lit`.
2019-11-13 08:27:27 +02:00
Michael Wright
2d244d3358 literal representation restructure 4
Simplify `grouping_hint` by splitting digits into parts and handling
one at a time.

Fixes #4762
2019-11-13 08:27:19 +02:00
Michael Wright
2e8946a6de literal representation restructure 3
Move suffix check into `check_lit` so that it isn't done repeatedly.
2019-11-13 08:27:14 +02:00
Michael Wright
2dbd34ffe8 literal representation restructure 2
Consolidate warning handling using "poor man's try".
2019-11-13 08:27:05 +02:00
Michael Wright
8f5b4f3f5c literal representation restructure 1
Combine macro expansion checks. Indentation is a little strange to
avoid rustfmt issue.
2019-11-13 08:26:52 +02:00
Andy Russell
add766493a
don't warn on CRLF in with_newline lints 2019-11-12 08:50:22 -05:00
bors
2646b108d5 Auto merge of #4803 - tomprogrammer:issue-4732, r=phansch
Fix false positive in explicit_counter_loop lint

When the counter was used in a closure after the loop the lint didn't detect the
usage of the counter correctly.

changelog: Fix false positive in `explicit_counter_loop`

Fixes #4732
2019-11-11 19:24:20 +00:00
Manish Goregaokar
e9a3e54910 MutImmutable -> Immutable, MutMutable -> Mutable, CaptureClause -> CaptureBy 2019-11-11 10:58:39 -08:00
bors
79d3b30cd7 Auto merge of #4801 - mikerite:to_digit_is_some, r=flip1995
To digit is some

Add a lint that recommends replacing `to_digit().is_some()` with `is_digit()` on `char`s

changelog: Add lint `to_digit_is_some`
2019-11-11 11:28:27 +00:00
Thomas Bahn
c88afce6fc Fix false positive in explicit_counter_loop lint
When the counter was used in a closure after the loop the lint didn't detect the
usage of the counter correctly.
2019-11-11 11:36:53 +01:00
bors
338f5e6801 Auto merge of #4780 - flip1995:ice_4775, r=phansch
Fix ICE #4775

Fixes #4775

changelog: Fix ICE with const_generics
2019-11-11 06:23:27 +00:00
Michael Wright
c1fd75005e Fix breakage due to rust-lang/rust#65324 2019-11-11 06:22:50 +02:00
Michael Wright
89b966cdf1 Really fix to_digit_is_some documentation 2019-11-10 18:00:04 +02:00
Michael Wright
9aefae4226 Fix to_digit_is_some documentation 2019-11-10 17:58:17 +02:00
Michael Wright
a9b5b36769 Fix to_digit_is_some dogfood errors 2019-11-10 15:53:08 +02:00
Michael Wright
5817a4fa06 Add to_digit_is_some lint 2019-11-10 15:52:59 +02:00
Manish Goregaokar
3ef852b74c Rustup to rustc 1.40.0-nightly (ac162c6ab 2019-11-09) 2019-11-09 17:04:42 -08:00
bors
b0b3dc6e76 Auto merge of #4776 - mikerite:fix-4727, r=flip1995
Fix crash in `use-self` lint

Fixes #4727

changelog: Fix crash in `use-self` lint
2019-11-08 22:06:21 +00:00
HMPerson1
94b36d9ca4
dogfood 2019-11-08 15:41:54 -05:00
HMPerson1
d4758420e6
Rustup rust-lang/rust#66188 2019-11-08 15:12:08 -05:00
Michael Wright
9c48a2c39a Merge branch 'master' into fix-4727 2019-11-08 07:15:16 +02:00
Lzu Tao
ff5bf67b94 remove unused warnings 2019-11-08 10:23:42 +07:00
Lzu Tao
acbe224f6a rustup https://github.com/rust-lang/rust/pull/65916 2019-11-08 10:23:42 +07:00
bors
4be144af87 Auto merge of #4697 - Licenser:no-exit, r=flip1995
restriction lint for `std::process::exit`

Addition to #4655 - adds the lint checking for `std::process::exit`

changelog: add restriction lint for `std::process::exit`
2019-11-07 22:05:51 +00:00
bors
426c05ae33 Auto merge of #4758 - mikerite:dec_lit_20191031, r=flip1995
`DecimalLiteralRepresentation` simplification

Remove recalculation of literal value.

changelog: none
2019-11-07 21:06:18 +00:00
bors
842cfb0311 Auto merge of #4757 - evanjs:issue/4748, r=phansch
Fix Deprecated lints don't expand

### Move doc comments inside of declare_deprecated_lint macros so that they are picked up by lintlib.py

### fixes #4748

Unable to `cargo test` locally (I'm on NixOS, and keep getting errors that are similar to those #4714 might solve) but I have verified that all deprecated lints can now be expanded like other lints.

![2019-10-30_21:06:28](https://user-images.githubusercontent.com/1847524/67910501-5815de00-fb59-11e9-9fa2-91fe6a8b9bb9.png)

changelog: Show deprecated lints in lint documentation again
2019-11-07 20:47:14 +00:00
Heinz N. Gies
abdf027df3 Update clippy_lints/src/lib.rs
Co-Authored-By: Philipp Krones <hello@philkrones.com>
2019-11-07 17:11:06 +01:00
Heinz N. Gies
a984702b50 Update clippy_lints/src/lib.rs
Co-Authored-By: Philipp Krones <hello@philkrones.com>
2019-11-07 17:11:05 +01:00
Heinz N. Gies
eae6a62db7 Simplify dentry point detection 2019-11-07 17:11:05 +01:00
Heinz N. Gies
ffcf4bec0f Improve function checking 2019-11-07 17:10:18 +01:00
Heinz N. Gies
9471669e46 Exclude main from exit lint 2019-11-07 17:10:18 +01:00
Heinz N. Gies
60c2fdd0b9 Update lints 2019-11-07 17:10:18 +01:00
Heinz N. Gies
695aa59c6d Add lint for exit 2019-11-07 17:10:18 +01:00
flip1995
08fd397c2c
Deprecate into_iter_on_array lint
This lint was uplifted/reimplemented by rustc.
Rustup to rust-lang/rust#66017
2019-11-07 14:04:29 +01:00
flip1995
e917b01286
Rustup to rust-lang/rust#65884 2019-11-07 13:27:00 +01:00
Manish Goregaokar
305ba73fc1
Rustup to rustc 1.40.0-nightly (7a76fe76f 2019-11-07) 2019-11-07 13:14:40 +01:00
Michael Wright
e3c1aea157 use-self: correctly ignore dummy paths 2019-11-07 05:59:13 +02:00
flip1995
d3e88a58b9
Fix ICE #4775 2019-11-06 18:14:47 +01:00
bors
0be213bb79 Auto merge of #4772 - HMPerson1:tastier_ice_cream, r=flip1995
Use correct TypeckTables when hashing bodies

Fixes #4760

changelog: Fix ICE while hashing block expressions #4760

r? @phansch
2019-11-06 15:50:42 +00:00
Lzu Tao
42c8c03464 bump smallvec to 1.0.0 2019-11-06 17:46:45 +07:00
Lzu Tao
56f3ba33c5 chore: sort out clippy_lints deps 2019-11-06 17:46:45 +07:00
Lzu Tao
51632530d7 rustup rust-lang/rust#65776 2019-11-06 17:46:45 +07:00
Michael Wright
a952708b6c Fix crash in use-self lint
Fixes #4727
2019-11-06 07:33:56 +02:00
Lzu Tao
98313bd83a chore: remove unnecessary parentheses around type 2019-11-05 22:05:55 +07:00