Skip to content

Commit 664fb79

Browse files
committed
submodules: update clippy from f175352 to 6ce78d1
Changes: ```` wildcard_match_arm: Update lint count. wildcard_match_arm: add nesting issue to known. wildcard_match_arm: lint only enum matches. wildcard_match_arm: update ui test stderr wildcard_match_arm: format test. wilcard_match_arm: run rustfmt. wildcard_match_arm: add lint properly. wildcard_match_arm: rename function. wildcard_match_arm: add simple ui test. wildcard_match_arm: expand lint scope. Change match_wild lint name to WILDCARD_MATCH_ARM. Add match_wild lint (rust-lang#3649). fetch_prs_between: add .sh file ending cargo fmt Update various docs Use built-in entry_fn detection over self-built cargo fmt Reorganize conditionals: Run faster checks first Maybe fix ICE? Add initial version of const_fn lint Fix `unit_arg` false positive Rustfmt Check hypothetically failing conversion Remove tests for deprecated items Update more changed iterator paths Atomics constants are now handled by the deprecation lint Update changed iterator paths Update const slice processing update test stderr run cargo fmt rustup rust-lang/rust#57907 Fix documentation for `slow_vector_initialization` rustup rust-lang/rust#57726 Remove unsafe_vector_initialization from added lints Prevent incorrect cast_lossless suggestion in const_fn Incorporate review suggestions Fix dogfood tests on Appveyor test(versioncheck): Use .no_deps() test(versioncheck): Fix version equality check chore(cargo/dependencies/cargo-metadata): Upgrade to 0.7.1 dependencies: update itertools from 0.7 to 0.8 Add script to fetch GitHub PRs between two commits gitattributes: Treat .fixed files as rust files Update changelog with all changes since 0.0.212 Fix `expect_fun_call` lint suggestions ````
1 parent 8443444 commit 664fb79

File tree

169 files changed

+1700
-487
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+1700
-487
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
* text=auto eol=lf
44
*.rs rust
5+
*.fixed linguist-language=Rust

CHANGELOG.md

Lines changed: 125 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,128 @@
11
# Change Log
2+
23
All notable changes to this project will be documented in this file.
34

4-
## 0.0.212
5+
## Unreleased / In Rust Beta or Nightly
6+
7+
[b2601be...master](https://github.com/rust-lang/rust-clippy/compare/b2601be...master)
8+
9+
## Rust 1.32 (2019-01-17)
10+
11+
[2e26fdc2...b2601be](https://github.com/rust-lang/rust-clippy/compare/2e26fdc2...b2601be)
12+
13+
* New lints: [`slow_vector_initialization`], [`mem_discriminant_non_enum`],
14+
[`redundant_clone`], [`wildcard_dependencies`],
15+
[`into_iter_on_ref`], [`into_iter_on_array`], [`deprecated_cfg_attr`],
16+
[`mem_discriminant_non_enum`], [`cargo_common_metadata`]
17+
* Add support for `u128` and `i128` to integer related lints
18+
* Add float support to `mistyped_literal_suffixes`
19+
* Fix false positives in `use_self`
20+
* Fix false positives in `missing_comma`
21+
* Fix false positives in `new_ret_no_self`
22+
* Fix false positives in `possible_missing_comma`
23+
* Fix false positive in `integer_arithmetic` in constant items
24+
* Fix false positive in `needless_borrow`
25+
* Fix false positive in `out_of_bounds_indexing`
26+
* Fix false positive in `new_without_default_derive`
27+
* Fix false positive in `string_lit_as_bytes`
28+
* Fix false negative in `out_of_bounds_indexing`
29+
* Fix false negative in `use_self`. It will now also check existential types
30+
* Fix incorrect suggestion for `redundant_closure_call`
31+
* Fix various suggestions that contained expanded macros
32+
* Fix `bool_comparison` triggering 3 times on on on the same code
33+
* Expand `trivially_copy_pass_by_ref` to work on trait methods
34+
* Improve suggestion for `needless_range_loop`
35+
* Move `needless_pass_by_value` from `pedantic` group to `style`
36+
37+
## Rust 1.31 (2018-12-06)
38+
39+
[125907ad..2e26fdc2](https://github.com/rust-lang/rust-clippy/compare/125907ad..2e26fdc2)
40+
41+
* Clippy has been relicensed under a dual MIT / Apache license.
42+
See [#3093](https://github.com/rust-lang/rust-clippy/issues/3093) for more
43+
information.
44+
* With Rust 1.31, Clippy is no longer available via crates.io. The recommended
45+
installation method is via `rustup component add clippy`.
46+
* New lints: [`redundant_pattern_matching`], [`unnecessary_filter_map`],
47+
[`unused_unit`], [`map_flatten`], [`mem_replace_option_with_none`]
48+
* Fix ICE in `if_let_redundant_pattern_matching`
49+
* Fix ICE in `needless_pass_by_value` when encountering a generic function
50+
argument with a lifetime parameter
51+
* Fix ICE in `needless_range_loop`
52+
* Fix ICE in `single_char_pattern` when encountering a constant value
53+
* Fix false positive in `assign_op_pattern`
54+
* Fix false positive in `boxed_local` on trait implementations
55+
* Fix false positive in `cmp_owned`
56+
* Fix false positive in `collapsible_if` when conditionals have comments
57+
* Fix false positive in `double_parens`
58+
* Fix false positive in `excessive_precision`
59+
* Fix false positive in `explicit_counter_loop`
60+
* Fix false positive in `fn_to_numeric_cast_with_truncation`
61+
* Fix false positive in `map_clone`
62+
* Fix false positive in `new_ret_no_self`
63+
* Fix false positive in `new_without_default` when `new` is unsafe
64+
* Fix false positive in `type_complexity` when using extern types
65+
* Fix false positive in `useless_format`
66+
* Fix false positive in `wrong_self_convention`
67+
* Fix incorrect suggestion for `excessive_precision`
68+
* Fix incorrect suggestion for `expect_fun_call`
69+
* Fix incorrect suggestion for `get_unwrap`
70+
* Fix incorrect suggestion for `useless_format`
71+
* `fn_to_numeric_cast_with_truncation` lint can be disabled again
72+
* Improve suggestions for `manual_memcpy`
73+
* Improve help message for `needless_lifetimes`
74+
75+
## Rust 1.30 (2018-10-25)
76+
77+
[14207503...125907ad](https://github.com/rust-lang/rust-clippy/compare/14207503...125907ad)
78+
79+
* Deprecate `assign_ops` lint
80+
* New lints: [`mistyped_literal_suffixes`], [`ptr_offset_with_cast`],
81+
[`needless_collect`], [`copy_iterator`]
82+
* `cargo clippy -V` now includes the Clippy commit hash of the Rust
83+
Clippy component
84+
* Fix ICE in `implicit_hasher`
85+
* Fix ICE when encountering `println!("{}" a);`
86+
* Fix ICE when encountering a macro call in match statements
87+
* Fix false positive in `default_trait_access`
88+
* Fix false positive in `trivially_copy_pass_by_ref`
89+
* Fix false positive in `similar_names`
90+
* Fix false positive in `redundant_field_name`
91+
* Fix false positive in `expect_fun_call`
92+
* Fix false negative in `identity_conversion`
93+
* Fix false negative in `explicit_counter_loop`
94+
* Fix `range_plus_one` suggestion and false negative
95+
* `print_with_newline` / `write_with_newline`: don't warn about string with several `\n`s in them
96+
* Fix `useless_attribute` to also whitelist `unused_extern_crates`
97+
* Fix incorrect suggestion for `single_char_pattern`
98+
* Improve suggestion for `identity_conversion` lint
99+
* Move `explicit_iter_loop` and `explicit_into_iter_loop` from `style` group to `pedantic`
100+
* Move `range_plus_one` and `range_minus_one` from `nursery` group to `complexity`
101+
* Move `shadow_unrelated` from `restriction` group to `pedantic`
102+
* Move `indexing_slicing` from `pedantic` group to `restriction`
103+
104+
## Rust 1.29 (2018-09-13)
105+
106+
[v0.0.212...14207503](https://github.com/rust-lang/rust-clippy/compare/v0.0.212...14207503)
107+
108+
* :tada: :tada: **Rust 1.29 is the first stable Rust that includes a bundled Clippy** :tada:
109+
:tada:
110+
You can now run `rustup component add clippy-preview` and then `cargo
111+
clippy` to run Clippy. This should put an end to the continuous nightly
112+
upgrades for Clippy users.
113+
* Clippy now follows the Rust versioning scheme instead of its own
114+
* Fix ICE when encountering a `while let (..) = x.iter()` construct
115+
* Fix false positives in `use_self`
116+
* Fix false positive in `trivially_copy_pass_by_ref`
117+
* Fix false positive in `useless_attribute` lint
118+
* Fix false positive in `print_literal`
119+
* Fix `use_self` regressions
120+
* Improve lint message for `neg_cmp_op_on_partial_ord`
121+
* Improve suggestion highlight for `single_char_pattern`
122+
* Improve suggestions for various print/write macro lints
123+
* Improve website header
124+
125+
## 0.0.212 (2018-07-10)
5126
* Rustup to *rustc 1.29.0-nightly (e06c87544 2018-07-06)*
6127

7128
## 0.0.211
@@ -31,7 +152,7 @@ All notable changes to this project will be documented in this file.
31152

32153
## 0.0.203
33154
* Rustup to *rustc 1.28.0-nightly (a3085756e 2018-05-19)*
34-
* clippy attributes are now of the form `clippy::cyclomatic_complexity` instead of `clippy(cyclomatic_complexity)`
155+
* Clippy attributes are now of the form `clippy::cyclomatic_complexity` instead of `clippy(cyclomatic_complexity)`
35156

36157
## 0.0.202
37158
* Rustup to *rustc 1.28.0-nightly (952f344cd 2018-05-18)*
@@ -757,6 +878,7 @@ All notable changes to this project will be documented in this file.
757878
[`min_max`]: https://rust-lang.github.io/rust-clippy/master/index.html#min_max
758879
[`misaligned_transmute`]: https://rust-lang.github.io/rust-clippy/master/index.html#misaligned_transmute
759880
[`misrefactored_assign_op`]: https://rust-lang.github.io/rust-clippy/master/index.html#misrefactored_assign_op
881+
[`missing_const_for_fn`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
760882
[`missing_docs_in_private_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
761883
[`missing_inline_in_public_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_inline_in_public_items
762884
[`mistyped_literal_suffixes`]: https://rust-lang.github.io/rust-clippy/master/index.html#mistyped_literal_suffixes
@@ -906,6 +1028,7 @@ All notable changes to this project will be documented in this file.
9061028
[`while_let_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop
9071029
[`while_let_on_iterator`]: https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator
9081030
[`wildcard_dependencies`]: https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_dependencies
1031+
[`wildcard_enum_match_arm`]: https://rust-lang.github.io/rust-clippy/master/index.html#wildcard_enum_match_arm
9091032
[`write_literal`]: https://rust-lang.github.io/rust-clippy/master/index.html#write_literal
9101033
[`write_with_newline`]: https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline
9111034
[`writeln_empty_string`]: https://rust-lang.github.io/rust-clippy/master/index.html#writeln_empty_string

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ rustc_tools_util = { version = "0.1.1", path = "rustc_tools_util"}
4747

4848
[dev-dependencies]
4949
clippy_dev = { version = "0.0.1", path = "clippy_dev" }
50-
cargo_metadata = "0.6.2"
50+
cargo_metadata = "0.7.1"
5151
compiletest_rs = "0.3.18"
5252
lazy_static = "1.0"
5353
serde_derive = "1.0"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code.
99

10-
[There are 292 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
10+
[There are 294 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
1111

1212
We have a bunch of lint categories to allow you to choose how much Clippy is supposed to ~~annoy~~ help you:
1313

clippy_dev/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2018"
66

77
[dependencies]
88
clap = "~2.32"
9-
itertools = "0.7"
9+
itertools = "0.8"
1010
regex = "1"
1111
lazy_static = "1.0"
1212
walkdir = "2"

clippy_dev/src/lib.rs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ pub fn gen_lint_group_list(lints: Vec<Lint>) -> Vec<String> {
8282
}
8383
})
8484
.sorted()
85+
.collect::<Vec<String>>()
8586
}
8687

8788
/// Generates the `pub mod module_name` list in `clippy_lints/src/lib.rs`.
@@ -98,6 +99,7 @@ pub fn gen_modules_list(lints: Vec<Lint>) -> Vec<String> {
9899
.unique()
99100
.map(|module| format!("pub mod {};", module))
100101
.sorted()
102+
.collect::<Vec<String>>()
101103
}
102104

103105
/// Generates the list of lint links at the bottom of the README
@@ -118,17 +120,20 @@ pub fn gen_changelog_lint_list(lints: Vec<Lint>) -> Vec<String> {
118120

119121
/// Generates the `register_removed` code in `./clippy_lints/src/lib.rs`.
120122
pub fn gen_deprecated(lints: &[Lint]) -> Vec<String> {
121-
itertools::flatten(lints.iter().filter_map(|l| {
122-
l.clone().deprecation.and_then(|depr_text| {
123-
Some(vec![
124-
" store.register_removed(".to_string(),
125-
format!(" \"{}\",", l.name),
126-
format!(" \"{}\",", depr_text),
127-
" );".to_string(),
128-
])
123+
lints
124+
.iter()
125+
.filter_map(|l| {
126+
l.clone().deprecation.and_then(|depr_text| {
127+
Some(vec![
128+
" store.register_removed(".to_string(),
129+
format!(" \"{}\",", l.name),
130+
format!(" \"{}\",", depr_text),
131+
" );".to_string(),
132+
])
133+
})
129134
})
130-
}))
131-
.collect()
135+
.flatten()
136+
.collect::<Vec<String>>()
132137
}
133138

134139
/// Gathers all files in `src/clippy_lints` and gathers all lints inside

clippy_lints/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ keywords = ["clippy", "lint", "plugin"]
1717
edition = "2018"
1818

1919
[dependencies]
20-
cargo_metadata = "0.6.2"
21-
itertools = "0.7"
20+
cargo_metadata = "0.7.1"
21+
itertools = "0.8"
2222
lazy_static = "1.0.2"
2323
matches = "0.1.7"
2424
quine-mc_cluskey = "0.2.2"

clippy_lints/src/approx_const.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ impl LintPass for Pass {
6060
fn get_lints(&self) -> LintArray {
6161
lint_array!(APPROX_CONSTANT)
6262
}
63+
64+
fn name(&self) -> &'static str {
65+
"ApproxConstant"
66+
}
6367
}
6468

6569
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {

clippy_lints/src/arithmetic.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ impl LintPass for Arithmetic {
5252
fn get_lints(&self) -> LintArray {
5353
lint_array!(INTEGER_ARITHMETIC, FLOAT_ARITHMETIC)
5454
}
55+
56+
fn name(&self) -> &'static str {
57+
"Arithmetic"
58+
}
5559
}
5660

5761
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Arithmetic {

clippy_lints/src/assertions_on_constants.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ impl LintPass for AssertionsOnConstants {
3434
fn get_lints(&self) -> LintArray {
3535
lint_array![ASSERTIONS_ON_CONSTANTS]
3636
}
37+
38+
fn name(&self) -> &'static str {
39+
"AssertionsOnConstants"
40+
}
3741
}
3842

3943
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssertionsOnConstants {

clippy_lints/src/assign_ops.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ impl LintPass for AssignOps {
5757
fn get_lints(&self) -> LintArray {
5858
lint_array!(ASSIGN_OP_PATTERN, MISREFACTORED_ASSIGN_OP)
5959
}
60+
61+
fn name(&self) -> &'static str {
62+
"AssignOps"
63+
}
6064
}
6165

6266
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
@@ -79,7 +83,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
7983
let r = &sugg::Sugg::hir(cx, rhs, "..");
8084
let long =
8185
format!("{} = {}", snip_a, sugg::make_binop(higher::binop(op.node), a, r));
82-
db.span_suggestion_with_applicability(
86+
db.span_suggestion(
8387
expr.span,
8488
&format!(
8589
"Did you mean {} = {} {} {} or {}? Consider replacing it with",
@@ -92,7 +96,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
9296
format!("{} {}= {}", snip_a, op.node.as_str(), snip_r),
9397
Applicability::MachineApplicable,
9498
);
95-
db.span_suggestion_with_applicability(
99+
db.span_suggestion(
96100
expr.span,
97101
"or",
98102
long,
@@ -179,7 +183,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
179183
if let (Some(snip_a), Some(snip_r)) =
180184
(snippet_opt(cx, assignee.span), snippet_opt(cx, rhs.span))
181185
{
182-
db.span_suggestion_with_applicability(
186+
db.span_suggestion(
183187
expr.span,
184188
"replace it with",
185189
format!("{} {}= {}", snip_a, op.node.as_str(), snip_r),

clippy_lints/src/attrs.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ impl LintPass for AttrPass {
199199
UNKNOWN_CLIPPY_LINTS,
200200
)
201201
}
202+
203+
fn name(&self) -> &'static str {
204+
"Attributes"
205+
}
202206
}
203207

204208
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
@@ -269,7 +273,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AttrPass {
269273
"useless lint attribute",
270274
|db| {
271275
sugg = sugg.replacen("#[", "#![", 1);
272-
db.span_suggestion_with_applicability(
276+
db.span_suggestion(
273277
line_span,
274278
"if you just forgot a `!`, use",
275279
sugg,
@@ -332,7 +336,7 @@ fn check_clippy_lint_names(cx: &LateContext<'_, '_>, items: &[NestedMetaItem]) {
332336
// https://github.com/rust-lang/rust/pull/56992
333337
CheckLintNameResult::NoLint(None) => (),
334338
_ => {
335-
db.span_suggestion_with_applicability(
339+
db.span_suggestion(
336340
lint.span,
337341
"lowercase the lint name",
338342
name_lower,
@@ -500,6 +504,10 @@ impl LintPass for CfgAttrPass {
500504
fn get_lints(&self) -> LintArray {
501505
lint_array!(DEPRECATED_CFG_ATTR,)
502506
}
507+
508+
fn name(&self) -> &'static str {
509+
"DeprecatedCfgAttribute"
510+
}
503511
}
504512

505513
impl EarlyLintPass for CfgAttrPass {

clippy_lints/src/bit_mask.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ impl LintPass for BitMask {
108108
fn get_lints(&self) -> LintArray {
109109
lint_array!(BAD_BIT_MASK, INEFFECTIVE_BIT_MASK, VERBOSE_BIT_MASK)
110110
}
111+
fn name(&self) -> &'static str {
112+
"BitMask"
113+
}
111114
}
112115

113116
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BitMask {
@@ -139,7 +142,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BitMask {
139142
"bit mask could be simplified with a call to `trailing_zeros`",
140143
|db| {
141144
let sugg = Sugg::hir(cx, left1, "...").maybe_par();
142-
db.span_suggestion_with_applicability(
145+
db.span_suggestion(
143146
e.span,
144147
"try",
145148
format!("{}.trailing_zeros() >= {}", sugg, n.count_ones()),

clippy_lints/src/blacklisted_name.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ impl LintPass for BlackListedName {
3737
fn get_lints(&self) -> LintArray {
3838
lint_array!(BLACKLISTED_NAME)
3939
}
40+
fn name(&self) -> &'static str {
41+
"BlacklistedName"
42+
}
4043
}
4144

4245
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BlackListedName {

clippy_lints/src/block_in_if_condition.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ impl LintPass for BlockInIfCondition {
4949
fn get_lints(&self) -> LintArray {
5050
lint_array!(BLOCK_IN_IF_CONDITION_EXPR, BLOCK_IN_IF_CONDITION_STMT)
5151
}
52+
53+
fn name(&self) -> &'static str {
54+
"BlockInIfCondition"
55+
}
5256
}
5357

5458
struct ExVisitor<'a, 'tcx: 'a> {

0 commit comments

Comments
 (0)