Commit graph

1868 commits

Author SHA1 Message Date
Manish Goregaokar
e9c025ea70 Add license header to Rust files 2018-10-06 09:43:08 -07:00
Manish Goregaokar
53d41e5c50 Rustup for https://github.com/rust-lang/rust/pull/54741 2018-10-05 13:41:40 -07:00
Manish Goregaokar
cbde8201c5 Remove unused utils 2018-10-05 13:26:39 -07:00
Manish Goregaokar
75965030c7
Merge pull request #3251 from rust-lang-nursery/relicense-rewrite
[do not merge] Relicensing rewrite
2018-10-05 20:14:55 +02:00
Philipp Hansch
1544a1a681
Merge remote-tracking branch 'origin/master' into relicense-rewrite 2018-10-05 07:18:24 +02:00
Joel Gallant
163780ee0b Solves #3222 by checking the BareFnTy Abi type 2018-10-04 18:49:03 -06:00
Philipp Hansch
391d53db66
Add hidden lifetime parameters to fix warning 2018-10-04 21:59:30 +02:00
Philipp Hansch
c0ab8b2531
Reimplement the fn_to_numeric_cast_with_truncation lint 2018-10-04 21:44:16 +02:00
Philipp Hansch
7adf24ebb0
Improve docs of fn_to_numeric_cast
Closes #2980
2018-10-04 18:09:09 +02:00
Matthias Krüger
fd5ea0ddf7 resolve build warnings in clippy_lints/src/format.rs 2018-10-04 16:34:41 +02:00
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer
c3e3be374b
Merge pull request #3256 from rust-lang-nursery/fix-2796
Fix 2796 and 3020
2018-10-04 08:51:00 +02:00
mcarton
5173ed0c03 Don't suggest to_string().to_string in USELESS_FORMAT 2018-10-03 20:59:59 +02:00
Philipp Hansch
f42272102a
Reimplement the fn_to_numeric_cast lint 2018-10-03 12:02:06 +02:00
Manish Goregaokar
c430147942 Fix push_item_path call (rustup to 4cf11765dc98536c6eedf33f2df7f72f6e161263) 2018-10-03 02:06:26 -07:00
mcarton
7eebd5b20c Ignore format! with precision in USELESS_FORMAT 2018-10-02 23:57:22 +02:00
Oliver Schneider
913a5c9b56 Trailing newline 2018-10-02 15:18:56 +02:00
Oliver Schneider
696dc369df FIx dogfood 2018-10-02 15:17:56 +02:00
Oliver Schneider
b36bb0a68d Reimplement the map_clone lint from scratch 2018-10-02 15:13:43 +02:00
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer
11cc8472a9
Merge pull request #3245 from JoshMcguigan/wrong_self_convention-1530
Correct false positive in wrong_self_convention lint for to_mut
2018-10-02 14:54:36 +02:00
Josh Mcguigan
f142098474 Correct false positive in wrong_self_convention lint for to_mut 2018-10-02 04:47:38 -07:00
Manish Goregaokar
057243f16b relicensing: Remove map_clone
This removes the code added in https://github.com/rust-lang-nursery/rust-clippy/pull/427
2018-10-02 12:51:38 +02:00
Manish Goregaokar
fffcd093b2 relicensing: Remove fn_to_numeric_cast, fn_to_numeric_cast_with_truncation
This removes the code added in https://github.com/rust-lang-nursery/rust-clippy/pull/2814
2018-10-02 12:49:27 +02:00
Manish Goregaokar
be1094bd8d ScalarMaybeUndef -> Scalar (Rustup to e812ca472a2a5284e9f15cd9af32285d7ff3fd39) 2018-10-02 10:35:26 +02:00
Philipp Hansch
eb5f146f14
Fix 'impossible case reached' ICE 2018-10-01 22:34:52 +02:00
Matthias Krüger
91f7e22edf remove cargo edition 2018 feature gate.
Rust and the cargo used to bootstrap was updated in https://github.com/rust-lang/rust/pull/54601 which now has the 2018 edition stabilized.
2018-09-30 11:12:24 +02:00
Michael Wright
50133fbd3a Merge branch 'master' into unnecessary_filter_map 2018-09-30 06:39:56 +02:00
Josh Mcguigan
e25f884e6f Fixes #3180, suppress excessive_precision lint for floats with no decimal part 2018-09-29 07:39:30 -07:00
Michael Wright
c2ee9c29ab Merge branch 'master' into unnecessary_filter_map 2018-09-29 15:27:47 +02:00
Michael Wright
06f6b36025 rustfmt 2018-09-29 14:18:50 +02:00
Michael Wright
efdc739dfc Move unnecessary_filter_map to a submodule 2018-09-29 14:12:40 +02:00
Philipp Krones
67d85bc47d
Merge pull request #3224 from matthiaskrgr/clippy_self__use_self
fix some clippy::pedantic warnings found in the codebase.
2018-09-28 15:26:50 +02:00
Philipp Hansch
8e808664fa
Merge pull request #3178 from ms2300/bad_unwrap
Fix for bad get unwrap suggestion
2018-09-28 07:38:00 +01:00
Michael Wright
4b4d758ce0 Fix warnings in clippy_lints 2018-09-27 06:29:48 +02:00
Michael Wright
2f364d9ac5 Merge branch 'master' into unnecessary_filter_map 2018-09-27 06:12:01 +02:00
Matthias Krüger
9fae4693f9 fix clippy::single-match-else and clippy::match_same_arms warnings in clippys codebase 2018-09-26 22:25:01 +02:00
Matthias Krüger
2a31937cc9 fix all clippy::use_self pedantic warnings found in the codebase.
cc #3172
2018-09-26 22:24:18 +02:00
Matthias Krüger
fc35c20a0a rustup
fix breakage by https://github.com/rust-lang/rust/pull/53824

use smallvec crate instead of rustcs type alias.
2018-09-26 15:57:38 +02:00
Michael Wright
f5ffac4fce Implement unnecesary_filter_map lint 2018-09-26 06:52:36 +02:00
Jane Lusby
14feb3670f Lint for chaining flatten after map
This change adds a lint to check for instances of `map(..).flatten()`
that can be trivially shortened to `flat_map(..)`

Closes #3196
2018-09-24 14:29:16 -07:00
Michael Wright
ab71f08663 Fix single_char_pattern crash (#3204)
This commit fixes the crash by removing constant checking from the lint.

Closes #3204.
2018-09-24 08:33:57 +02:00
ms2300
523ba2a009 Full fix of get unwrap issue 2018-09-23 19:53:25 -07:00
ms2300
de8d233b06 #3006 : Fixing for .get().unwrap().foo() 2018-09-23 19:53:25 -07:00
Philipp Krones
bc6d85ceaf
Merge pull request #3207 from mikerite/fix-3206
Fix double_parens false positive
2018-09-23 18:24:27 +02:00
Philipp Krones
af2d6a0c14
Merge pull request #3191 from vi/suggest_with_applicability
Use span_suggestion_with_applicability instead of span_suggestion
2018-09-23 15:45:55 +02:00
Michael Wright
867ac98d38 Fix double_parens false positive
Closes #3206
2018-09-22 17:20:34 +02:00
flip1995
987b34d090
Another Applicability adjustment 2018-09-20 14:38:48 +02:00
Vitaly _Vi Shukela
52fb7d461e
Applicability adjustment per additional comments 2018-09-20 14:38:48 +02:00
Vitaly _Vi Shukela
58729346be
Fill in Applicability from review comments by @flip1995 2018-09-20 14:38:48 +02:00
Vitaly _Vi Shukela
3eccccb367
Fix indents 2018-09-20 14:38:48 +02:00
Vitaly _Vi Shukela
2781cac839
Apply subset of "cargo fmt". 2018-09-20 14:38:47 +02:00
Vitaly _Vi Shukela
3e853a632e
Add forgotten function: span_suggestion*s* to the previous refactoting 2018-09-20 14:38:47 +02:00
Vitaly _Vi Shukela
d4c994e670
Supplement DiagnosticBuilderExt with Applicability 2018-09-20 14:38:47 +02:00
Vitaly _Vi Shukela
92034e20c8
Use span_suggestion_with_applicability instead of span_suggestion 2018-09-20 14:38:47 +02:00
Jay Kickliter
79cda3bb1e mem_replace: fix grammar. 2018-09-19 14:54:38 -07:00
Jay Kickliter
2f53aaa5bd mem_replace: match on path. 2018-09-19 14:41:22 -07:00
Jay Kickliter
12c7bc1e58 mem_replace: apply update_lints tool. 2018-09-19 14:41:22 -07:00
Jay Kickliter
1b6d739ce3 mem_replace: make examples compilable. 2018-09-19 14:38:34 -07:00
Jay Kickliter
598df08d88 Add lint for mem::replace(.., None).
Suggest `Option::take()` as an alternative.
2018-09-19 14:38:34 -07:00
Philipp Hansch
b6707ffc42
Merge pull request #3187 from flip1995/internal_fn
New internal lint: compiler_lint_functions
2018-09-19 19:43:48 +01:00
flip1995
a8b681cc2c
Fix c_void path
This got changed in rust-lang/rust#53910
2018-09-17 11:20:27 +02:00
Michael Wright
c78cf042ff Remove unneeded check for method call
The check can be removed because the call to `method_chains_args`
already performs this check.
2018-09-16 13:08:00 +02:00
flip1995
021748eb6a
Replace another occurrence of "".to_owned() 2018-09-15 11:25:40 +02:00
Matthias Krüger
f3add4acb4
convert "".to_string() and "".to_owned() to String::new() 2018-09-15 11:20:35 +02:00
flip1995
144281c537
Formatting 2018-09-15 11:02:00 +02:00
flip1995
a4e1a90705
Fix warnings of compiler_lint_functions 2018-09-15 11:02:00 +02:00
flip1995
aaeeaa5330
Add internal lint compiler_lint_functions 2018-09-15 11:01:16 +02:00
Eduard-Mihai Burtescu
c70bfb2cac Revert "the cargo feature: edition 2018 is stabilized in current nightly"
This reverts commit 404a09d61c.
2018-09-15 11:16:45 +03:00
Eduard-Mihai Burtescu
85caaf5905 Fix useless_attribute to also whitelist unused_extern_crates. 2018-09-15 11:16:45 +03:00
Eduard-Mihai Burtescu
9219fc6c5c Reintroduce extern crate for non-Cargo dependencies. 2018-09-15 11:10:51 +03:00
Philipp Hansch
4aaef72fa0
Merge pull request #3186 from flip1995/pedantic_filter_map
Fix pedantic filter_map warnings
2018-09-14 19:47:50 +01:00
flip1995
582ab5a0d0
Reapply: "the cargo feature: edition 2018 is stabilized in current nightly"
This reapplies commit 404a09d.

Cargo got bumped in rust-lang/rust#54210
2018-09-14 13:43:20 +02:00
flip1995
f49f133cba
Fix pedantic filter_map warnings 2018-09-14 12:56:25 +02:00
Manish Goregaokar
7b530c79b2 Add match on StructCtor 2018-09-14 12:41:20 +05:30
Philipp Hansch
dac5e2d3a5
Merge pull request #3140 from matthiaskrgr/redundant_casts
fix warnings about trivial casts, mostly {i,u}128 -> {i,u}128, such as "i128::min_value() as i128"
2018-09-13 20:37:13 +01:00
Philipp Hansch
07cb45bc85
Merge pull request #3166 from flip1995/travis_internal
Run internal lints on the Clippy code base
2018-09-13 17:22:48 +01:00
Matthias Krüger
28424ecbfa fix warnings about trivial casts, mostly {i,u}128 -> {i,u}128, such as "i128::min_value() as i128" 2018-09-13 07:59:12 +02:00
Philipp Hansch
e8400061bd
Merge pull request #3085 from mikerite/revert-98dbce
Revert "Fix E0502 warnings"
2018-09-13 06:33:26 +01:00
Boyu Yang
4827ab978e
Remove a wrong suggestion. 2018-09-13 13:01:23 +08:00
Boyu Yang
60e8da1647
Fix typo in examples. 2018-09-13 11:51:58 +08:00
flip1995
e28440d2e0
Change Hash{Map, Set} to FxHash{Map, Set} 2018-09-12 01:34:52 +02:00
flip1995
cfa3c33b1d
Fix lint_without_lint_pass lint 2018-09-12 01:34:04 +02:00
Oliver Schneider
1128505fdd Revert "the cargo feature: edition 2018 is stabilized in current nightly"
This reverts commit 404a09d61c.
2018-09-10 16:02:17 +02:00
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer
c884357849
Merge pull request #3160 from matthiaskrgr/ed_2018
the cargo feature: edition 2018 is stabilized in current nightly
2018-09-10 13:57:55 +02:00
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer
1c1030f83f
Merge pull request #3152 from PSeitz/master
fixes #3151 by skipping the lint instead of crashing
2018-09-10 13:44:47 +02:00
Pascal Seitz
d512c2bcce add spaces 2018-09-10 09:03:33 +02:00
Matthias Krüger
404a09d61c the cargo feature: edition 2018 is stabilized in current nightly 2018-09-10 03:01:51 +02:00
Philipp Krones
f30cf51a70
Merge pull request #3135 from JoshMcguigan/explicit_counter_loop-1219
Closes #1219 false positive for explicit_counter_loop
2018-09-09 23:49:03 +02:00
Pascal Seitz
43549ebbf8 fixes #3151 by skipping the lint instead of crashing 2018-09-08 15:30:50 +02:00
Josh Mcguigan
9168746c38 Corrected explicit_counter_loop behavior with nested loops 2018-09-07 20:46:36 -07:00
Josh Mcguigan
53c262048c Fix #1219 false positive for explicit_counter_loop 2018-09-07 19:58:19 -07:00
Matthias Krüger
f6935be71e clippy_lints: enable crate_visibility_modifier since it is used but no longer part of 2018 edition.
Fixes build with https://github.com/rust-lang/rust/pull/53999
2018-09-08 01:32:40 +02:00
flip1995
fa3e3cb6ea
Fix #3145 by removing assert 2018-09-07 17:18:00 +02:00
Josh Mcguigan
ce554267b8 Updated explicit_counter_loop tests based on discussion in #3135 2018-09-07 05:32:56 -07:00
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer
63a46b1e1a
Merge pull request #3129 from mipli/3091-numeric-typo
Add lint for misstyped literal casting
2018-09-07 09:54:43 +02:00
Michael A. Plikk
7bf8d8ba09 Simplified boolean expression for checking literal suffixes 2018-09-06 17:19:38 +02:00
Michael A. Plikk
986c772c24 Reduce number of split_at calls 2018-09-06 16:26:17 +02:00
Josh Mcguigan
edfa9feac2 Corrected explicit_counter_loop missing lints if variable used after loop 2018-09-06 06:20:25 -07:00
Matthias Krüger
a0f56edfc3 print_with_newline / write_with_newline: don't warn about string with several \ns in them.
Fixes #3126
2018-09-06 12:59:34 +02:00
Matthias Krüger
0a8ceaf8b0 rustfmt clippy_lints/src/write.rs 2018-09-06 12:33:00 +02:00
Matthias Krüger
554fe1ed5c remove "clippy::" lint prefix from lint name in doc url.
Fixes #3132
2018-09-06 00:45:57 +02:00