Philipp Krones
b4524004e0
Rollup merge of #4830 - lzutao:str-repeat, r=flip1995
...
use more efficient code to generate repeated string
see https://rust.godbolt.org/z/z9vrFP for comparison
changelog: none
2019-11-23 18:16:03 +01:00
Philipp Krones
ae69bc4980
Rollup merge of #4820 - guanqun:comment-fix, r=flip1995
...
doc: fix the comment above the lint function
it's a simple comment fix.
---
changelog: none
2019-11-23 18:16:01 +01:00
Philipp Krones
623d8c4640
Rollup merge of #4811 - mikerite:lit_repr_20191113, r=flip1995
...
Literal Representation Restructure
This pull request restructures the literal_representation module to be easier to understand and maintain. I split the changes into a lot of commits to make reviewing easier.
changelog: none
2019-11-23 18:16:00 +01:00
Philipp Krones
93d84d7dda
Rollup merge of #4766 - phansch:fix_fp_in_derive_hash_xor_eq, r=flip1995
...
Fix false positive in derive_hash_xor_eq
This fixes a false positive in derive_hash_xor_eq where the lint was
triggering on user-defined traits called `Hash`.
changelog: Fix false positive in `derive_hash_xor_eq`
Fixes #4658
2019-11-23 18:15:59 +01:00
Philipp Krones
016857db65
Rollup merge of #4730 - yerke:fix-check_infinite_loop, r=flip1995
...
Fix check_infinite_loop (while_immutable_condition) by checking for break or return inside loop body
changelog: Fix check_infinite_loop (while_immutable_condition) by checking for break or return inside loop body
fixes #4648
2019-11-23 18:15:58 +01:00
bors
60e8413a4e
Auto merge of #4825 - Manishearth:rustup, r=flip1995
...
Rustup to rustc 1.41.0-nightly (35ef33a8
2019-11-21)
I don't have the right fix for the fmtstr tests, and I'm also hitting problems caused by https://github.com/messense/rustc-test/issues/3
List of rustups:
- rust-lang/rust#66271 (syntax: Keep string literals in ABIs and `asm!` more precisely)
- rust-lang/rust#65355 (Stabilize `!` in Rust 1.41.0)
- rust-lang/rust#66515 (Reduce size of `hir::Expr` by boxing more of `hir::InlineAsm`)
- rust-lang/rust#66389 (Specific labels when referring to "expected" and "found" types)
- rust-lang/rust#66074 ([mir-opt] Turn on the `ConstProp` pass by default)
changelog: none
2019-11-23 15:54:33 +00:00
flip1995
553db874d7
Disable chalk integration test. Output too large
2019-11-23 16:49:47 +01:00
flip1995
fb18354e5d
Temporarily disable serde integration test
...
ICEs because of rustc, not Clippy
2019-11-23 16:47:59 +01:00
flip1995
7bae5bd828
Add comment for mir_opt_level=0
2019-11-23 01:26:19 +01:00
Yerkebulan Tulibergenov
1cba0c9f7d
fix check_infinite_loop by checking for break or return inside loop body
2019-11-22 09:13:46 -08:00
flip1995
e3a74ed2b5
Set mir_opt_level=0
...
This introduces some FNs. But a building Clippy is more important for now
2019-11-22 14:25:44 +01:00
flip1995
cadc35af5a
Rustup to rust-lang/rust#66389
2019-11-22 13:47:33 +01:00
flip1995
e4636f3c39
Rustup to rust-lang/rust#66515
...
Fixes #4835
2019-11-22 13:47:33 +01:00
flip1995
3c308b86c8
Remove never_type feature
...
Stablized in rust-lang/rust#65355
2019-11-22 13:47:33 +01:00
lzutao
d229d91d88
use usize::from
...
Co-Authored-By: Mateusz Mikuła <mati865@users.noreply.github.com>
2019-11-19 23:47:18 +07:00
Lzu Tao
4da0da9281
use more efficient code to generate repeated string
...
see https://rust.godbolt.org/z/z9vrFP for comparison
2019-11-19 23:08:50 +07:00
Manish Goregaokar
d183bda0be
Rustup to rustc 1.41.0-nightly ( d1da8023d
2019-11-19)
2019-11-19 00:32:35 -08:00
Manish Goregaokar
aa5a95f00c
Rustup to rustc 1.41.0-nightly ( a0d40f8bd
2019-11-18)
2019-11-18 23:49:58 -08:00
Guanqun Lu
f2d8197110
doc: fix the comment above the lint function
2019-11-16 01:55:06 +08:00
bors
b4f1769734
Auto merge of #4815 - JohnTitor:rustup, r=matthiaskrgr
...
Rustup rust-lang/rust#66233
changelog: none
2019-11-14 10:00:18 +00:00
Yuki Okushi
0736dd9dfe
Rustup rust-lang/rust#66233
2019-11-14 17:44:23 +09:00
Michael Wright
ceb0b2d41a
literal repr: ignore more warnings in macros
2019-11-14 08:19:02 +02:00
Michael Wright
75e2dcf56b
literal representation: simplification
...
Simplify calculation in grouping. Add test case to ensure `count()`
can't be zero in that branch.
2019-11-14 07:42:04 +02:00
bors
0574d6612c
Auto merge of #4810 - Areredify:4716-fix, r=flip1995
...
clippy-driver display help on empty command line arguments
changelog: fixes #4716 , now displaying help if clippy-driver is run with no arguments.
2019-11-13 18:07:23 +00:00
bors
320b94d209
Auto merge of #4794 - rust-lang:no-must-use-impls, r=flip1995
...
no more must-use-candidate impls
This should help with #4779 .
changelog: don't trigger [`must_use_candidate`] on trait impls
2019-11-13 13:13:14 +00:00
Michael Wright
2e9d173be1
literal representation restructure 12
...
Export function for formatting literals and remove crate visibility from
other items.
2019-11-13 08:28:50 +02:00
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
Mikhail Babenko
227dc44aee
display help on empty command line arguments
2019-11-13 04:27:43 +03:00
Andre Bogus
5f0f67375d
no more must-use-candidate on trait impls
2019-11-12 23:36:22 +01:00
bors
180f87065f
Auto merge of #4769 - euclio:crlf, r=flip1995
...
don't warn on CRLF in `with_newline` lints
changelog: don't warn on CRLF in `print_with_newline` and `write_with_newline`
fixes #4208 .
This PR also transitions the unescaping logic to use the compiler's lexer.
2019-11-12 13:56:14 +00: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
bors
86b8643586
Auto merge of #4805 - Manishearth:rustup, r=phansch
...
Rustup to rustc 1.40.0-nightly (56237d75b
2019-11-11)
changelog: none
2019-11-11 18:59:06 +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
Philipp Hansch
78b7e8544b
Fix false positive in derive_hash_xor_eq
...
This fixes a false positive in derive_hash_xor_eq where the lint was
triggering on user-defined traits called `Hash`.
2019-11-11 07:59: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
bors
3abdd2f1ce
Auto merge of #4802 - mikerite:fix-breakage-20191111, r=phansch
...
Fix breakage due to rust-lang/rust#65324
changelog: none
2019-11-11 06:03:56 +00:00
Michael Wright
c1fd75005e
Fix breakage due to rust-lang/rust#65324
2019-11-11 06:22:50 +02:00