Commit Graph

489 Commits

Author SHA1 Message Date
Areredify
7fddac0404 Add new lint: large stack array
added documentation

minor style fix

change as to ::from

add ignore to doc

include threshold in lint message/make suggestion more apparent/use Scalar api instead of matching

style fix

shange snippet_opt to snippet
2019-11-13 21:44:29 +03:00
Michael Wright
5817a4fa06 Add to_digit_is_some lint 2019-11-10 15:52:59 +02:00
Heinz N. Gies
60c2fdd0b9 Update lints 2019-11-07 17:10:18 +01:00
Marcel Hellwig
5572476a36 Add lint for debug_assert_with_mut_call
This lint will complain when you put a mutable function/method call
inside a `debug_assert` macro, because it will not be executed in
release mode, therefore it will change the execution flow, which is not
wanted.
2019-10-22 10:39:55 +02:00
Heinz N. Gies
7f454d8d06 Split out tests 2019-10-18 07:40:48 +02:00
Heinz N. Gies
98dc3aabea Add todo and tests 2019-10-18 07:37:58 +02:00
HMPerson1
76b44f34b9
Add inefficient_to_string lint 2019-10-16 15:54:20 -04:00
James Wang
664522badd
Add a new lint for unused self 2019-10-15 09:58:11 +02:00
Andre Bogus
cc622608db new lints around #[must_use] fns
`must_use_unit` lints unit-returning functions with a `#[must_use]`
attribute, suggesting to remove it.

`double_must_use` lints functions with a plain `#[must_use]`
attribute, but which return a type which is already `#[must_use]`,
so the attribute has no benefit.

`must_use_candidate` is a pedantic lint that lints functions and
methods that return some non-unit type that is not already
`#[must_use]` and suggests to add the annotation.
2019-10-14 12:09:04 +02:00
Nikos Filippakis
5143fe1a78 New lint: suspicious_unary_op_formatting
Lints when, on the RHS of a BinOp, there is a UnOp without a space
before the operator but with a space after (e.g. foo >- 1).

Signed-off-by: Nikos Filippakis <nikolaos.filippakis@cern.ch>
2019-10-09 16:22:00 +02:00
Ethan Lam
327c91f8c7 Addresses Issue #4001
Fixed typo

Fixes lint name and uses appropriate linting suggestion

changed lint help message

Added autofixable test

Added Autofixable Test

Removed Broken Autofixable File

updated lints

Generated Autofixable/Nonfixable Test Cases

Changed Suggestion Applicability

Updated Lint Count
2019-10-08 08:46:29 -05:00
Andre Bogus
27fa2b7944 New lint: unsound_collection_transmute 2019-10-02 21:18:00 +02:00
Andre Bogus
23a9c02120 New lint: needless_doc_main 2019-10-02 17:17:22 +02:00
James Wang
52408f5b7d
Add a new lint for comparison chains 2019-09-24 16:55:05 -05:00
bors
0fcb49ee30 Auto merge of #4566 - phansch:update_changelog2, r=flip1995
Update the changelog for Rust 1.38

[Rendered](https://github.com/phansch/rust-clippy/blob/update_changelog2/CHANGELOG.md#rust-138)

changelog: none
2019-09-23 07:11:21 +00:00
Philipp Hansch
b451e43098
Update the changelog for Rust 1.38 2019-09-22 19:19:59 +02:00
Michael Wright
d04bf15114 Merge branch 'master' into unneeded_wildcard_pattern 2019-09-22 08:59:23 +02:00
Andre Bogus
8d884c8a1a new lint: mem-replace-with-uninit 2019-09-20 00:25:57 +02:00
Andre Bogus
70a7dab773 New lint: Require # Safety section in pub unsafe fn docs 2019-09-19 09:19:55 +02:00
Michael Wright
4a3bc6b592 Add unneeded-wildcard-pattern lint 2019-09-12 08:25:05 +02:00
Shotaro Yamada
4960f79476 Add manual_saturating_arithmetic lint 2019-09-04 18:38:25 +09:00
Andre Bogus
b01f2d1126 lint against MaybeUninit::uninit().assume_init() 2019-09-03 17:37:38 +02:00
bors
6d9ee9e5eb Auto merge of #4372 - phansch:changelog_update, r=flip1995
docs: Explain how to update the changelog

cc @Manishearth Is this more or less how you did it last time?

[Rendered](https://github.com/phansch/rust-clippy/blob/changelog_update/doc/changelog_update.md#changelog-update)

changelog: none
2019-08-21 08:46:10 +00:00
Lzu Tao
7065239da5 Add option_and_then_some lint 2019-08-19 03:54:40 +00:00
Jeremy Stucki
f4f31a4ff4
Implement lint 'suspicious_map' 2019-08-15 22:58:32 +02:00
Philipp Hansch
171f307b65
Fix links to lints in changelog 2019-08-14 20:39:01 +02:00
Philipp Hansch
22c649a8a6
Update changelog for Rust 1.37
Also updates the rest of the changelog wrt. to the latest releases.
2019-08-14 20:20:51 +02:00
bors
06430e7af4 Auto merge of #4363 - phansch:fix_lint_deprecation, r=flip1995
Update lint deprecation for tool lints

changelog: Allow tool lints (`clippy::*`) to be deprecated

Our lint deprecation previously didn't work for tool lints, because
`register_removed` was registering lints to be removed _without_ the
`clippy` prefix.

Fixes #4349
2019-08-14 11:37:10 +00:00
Philipp Hansch
b50c13c578
Fix invalid_ref deprecation 2019-08-12 19:42:23 +02:00
Jeremy Stucki
b651f19eb8
Rename 'flat_map' → 'flat_map_identity' 2019-08-11 20:34:25 +02:00
Jeremy Stucki
05d9f884e1
Merge branch 'origin/master' into flat-map 2019-08-11 19:22:40 +02:00
Ralf Jung
40fea7a9e0 update_lints 2019-08-11 11:02:25 +02:00
Philipp Hansch
8d24facccb
docs: Explain how to update the changelog 2019-08-11 09:24:03 +02:00
Vincent Dal Maso
77b21b644f
Move expression check to LateLintPass
Changes:
- Move from EarlyLintPass
- Fix entrypoint check with function path def_id.
2019-08-05 13:23:30 +02:00
xd009642
925e8207fa Respond to review comments
Update README and CHANGELOG using the util scripts, refine the help message and fix the float_cmp error.
2019-07-27 21:58:29 +01:00
Darth-Revan
0513202d25
Implement lint for inherent to_string() method. 2019-07-17 08:58:32 +02:00
Jeremy Stucki
c7da4c26fb
Implement flat_map lint 2019-07-08 17:11:54 +02:00
Joe Frikker
60a80849ce Adding try_err lint 2019-06-22 16:37:05 -04:00
flip1995
a3f6f842ef
Unify heading style 2019-06-19 09:18:19 +02:00
Manish Goregaokar
83e5e8fcd0 Make headings stable 2019-06-18 15:12:18 -07:00
Manish Goregaokar
2d4fc585e1 Update changelog 2019-06-18 15:09:53 -07:00
krk
55740219b0
Rename REDUNDANT_STATIC_LIFETIME to REDUNDANT_STATIC_LIFETIMES. 2019-06-14 10:45:03 +02:00
krk
637e92d44e
Rename const_static_lifetime to redundant_static_lifetime. 2019-06-14 10:45:02 +02:00
krk
16bd4796e9
Add lint for statics with explicit static lifetime. 2019-06-14 09:41:46 +02:00
Thiago Arrais
b364eb7b54 Adds lint for integer division 2019-06-12 09:37:14 -03:00
Harrison McCullough
f32c2fcb7e Implement get_last_with_len lint 2019-05-20 18:01:21 -06:00
bors
fd56381015 Auto merge of #4088 - pJunger:check1, r=oli-obk
Added lint for TryFrom for checked integer conversion.

works towards #3947

Added lint for try_from for checked integer conversion.
Should recognize simple & straight-forward checked integer conversions.
2019-05-20 09:31:09 +00:00
Manish Goregaokar
a383e48241 Update master changelog
Up to 60a609acae
2019-05-18 09:02:11 -07:00
Manish Goregaokar
e2761311bb Update beta changelog 2019-05-18 08:38:29 -07:00
pJunger
47444c44ad Added lint for TryFrom for checked integer conversion rust-lang#3947. 2019-05-18 09:33:25 +02:00
Manish Goregaokar
373d270673 Rename to redundant_closure_for_method_calls 2019-05-16 09:18:50 -07:00
Michael Wright
4fcaab3d62 Split redundant_closure lint
Move the method checking into a new lint called
`redundant_closures_for_method_calls` and put it in the pedantic group.

This aspect of the lint seems more controversial than the rest.

cc #3942
2019-05-16 08:25:39 +02:00
André Luis Leal Cardoso Junior
b411391f8e Add lints for find_map 2019-04-30 16:45:28 -03:00
André Luis Leal Cardoso Junior
7e9cb5b84a Add lint PathBufPushOverwrite 2019-04-18 08:05:55 -03:00
Manish Goregaokar
737e45ad2d Link to ICEs 2019-04-14 08:17:01 -07:00
Philipp Hansch
02afbb9d61 Update CHANGELOG.md
Co-Authored-By: Manishearth <manishsmail@gmail.com>
2019-04-14 08:14:48 -07:00
Manish Goregaokar
22b9366e75 Beta changelog 2019-04-13 15:05:25 -07:00
Philipp Hansch
745d6fb74b
Mention configuration option for too_many_lines lint 2019-04-13 11:04:58 +02:00
Philipp Hansch
543858d741
Update changelog for Rust 1.34.0 2019-04-13 09:55:48 +02:00
Félix Fischer
069957a8ad Add TransmutingNull Lint
* Late Lint pass, catches:
  * One liner: 0 -> null -> transmute
  * One liner: std:null() -> transmute
  * Const (which resolves to null) -> transmute
* UI Test case for Lint
* Updated test for issue 3849, because now the lint that code generated is in Clippy.
* Expanded `const.rs` miri-based Constant Folding code, to cover
  raw pointers
2019-04-02 11:39:43 -03:00
Félix Fischer
ddc718087f Renamed: Cyclomatic Complexity -> Cognitive Complexity
* Ran automatic naming update

* Formalized rename of `cyclomatic_complexity` to `cognitive_complexity`
** Added the rename to `lib.rs`
** Added rename test

* Added warning for deprecated key `cyclomatic_complexity_threshold` and tests for it

* Added deprecation status for Clippy's builtin attribute

* Updated tests for new builtin attribute renaming
2019-03-06 10:07:38 -03:00
Philipp Hansch
64b400a1f4
Update changelog for Rust 1.33 2019-02-25 22:53:02 +01:00
Michael Howell
cb1c0b6849 Update README and CHANGELOG 2019-02-17 22:53:08 -07:00
rhysd
4b736ff29b Merge branch 'master' into issue3721 2019-02-03 21:27:23 +09:00
Unknown
93bf74a158 Running util/dev to update README/CHANGELOG 2019-02-01 13:21:19 -05:00
rhysd
9d130a546f add dbg_macro rule to CHANGELOG.md and update count in README 2019-02-01 11:32:22 +09:00
Alex Hamilton
efaed8e0c0 wildcard_match_arm: lint only enum matches. 2019-01-29 15:33:04 -06:00
Alex Hamilton
c75dfeb29b wildcard_match_arm: add lint properly. 2019-01-29 15:33:04 -06:00
Philipp Hansch
c3980bf0bc
Add initial version of const_fn lint 2019-01-29 08:19:05 +01:00
Philipp Hansch
59e176d4af
Remove unsafe_vector_initialization from added lints
It was deprecated before it reached a stable release,
no need to include it.
2019-01-26 12:50:40 +01:00
Philipp Hansch
1e4f44853c
Update changelog with all changes since 0.0.212 2019-01-24 20:14:33 +01:00
Abroskin Alexander
7075015f31
Merge branch 'master' into add-lints-aseert-checks 2019-01-09 13:49:40 +03:00
A.A.Abroskin
906b51637c change assert_checks to assertions_on_constants 2019-01-09 13:38:38 +03:00
Konrad Borowski
34daf09aa4 cast_ref_to_mut lint 2019-01-07 14:37:28 +01:00
A.A.Abroskin
96058616e2 run ./util/dev update_lints 2019-01-07 13:33:06 +03:00
Matthias Krüger
3389a68834 Revert "Auto merge of #3603 - xfix:random-state-lint, r=phansch"
This reverts commit 0a6593cd1b, reversing
changes made to 5277a1fb6c.

This hopefully fixes #3628
2019-01-05 10:19:04 +01:00
Konrad Borowski
a6c4eaa93c random_state lint 2018-12-30 02:45:34 +01:00
Russell Greene
d127aed737 Merge new_without_default_derive into new_without_default 2018-12-28 10:57:58 -07:00
flip1995
d74288efce
Run update_lints after renaming 2018-12-17 14:33:05 +01:00
Klaus Purer
355018d086 fix(module_name_repeat): Try to register renamed lint, not valid yet 2018-12-16 22:49:46 +01:00
Kampfkarren
db00c3320f Remove references to sized for end users 2018-12-13 10:18:17 -08:00
Kampfkarren
e5ea5395b9 Update lint definitions 2018-12-13 09:14:01 -08:00
daxpedda
aed2b986e6 Renamed to implicit_return.
Covered all other kinds besides `ExprKind::Lit`.
Added check for replacing `break` with `return`.
2018-12-05 14:39:09 +01:00
daxpedda
978f8c65ee Renamed forced_return to missing_returns.
Better clarification in the docs.
Ran `update_lints`.
2018-12-05 10:54:21 +01:00
Guillem Nieto
dc35841be4 Update lints 2018-11-25 14:36:04 -08:00
Matthias Krüger
d48af43cdf run "util/dev update_lints" 2018-11-22 04:43:33 +01:00
Yusuf Simonson
866caabb7a Check for common metadata 2018-11-13 08:43:30 -05:00
flip1995
bb4083c412
Run update_lints.py script 2018-11-02 19:50:23 +01:00
kennytm
2d1c9313b0
Added lints into_iter_on_ref and into_iter_on_array. Fix #1565. 2018-11-02 22:53:56 +08:00
flip1995
6819127f1e
run update_lints script 2018-11-02 13:49:10 +01:00
Shotaro Yamada
5285372f68 Run update_lints 2018-10-26 01:16:14 +09:00
HMPerson1
aabf8083bd
Add lint for calling mem::discriminant on a non-enum type 2018-10-24 23:39:54 -04:00
Hidehito Yabuuchi
d334fab4d0 Run util/update_lints.py 2018-10-24 15:00:28 +09:00
CYBAI
66ae3b1249 Rename if_let_redundant_pattern_matching to redundant_pattern_matching
Also, making the old one deprecated
2018-10-17 11:20:42 +08:00
Andre Bogus
e8687a6677 unused unit lint 2018-10-13 00:42:55 +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
Jay Kickliter
12c7bc1e58 mem_replace: apply update_lints tool. 2018-09-19 14:41:22 -07:00
Michael Wright
c06551aba7 Update lint list 2018-09-19 07:39:50 +02:00
Michael A. Plikk
38d287fecd Add lint for misstyped literal casting 2018-09-05 19:46:49 +02:00
Philipp Hansch
0961c692fa
s/wiki/lint list/ 2018-07-25 08:22:52 +02:00
Manish Goregaokar
d914106d87 Bump to 0.0.212 2018-07-06 23:23:19 -07:00
gnzlbg
7c4ec40346 add missing_inline lint
When turned on, the lint warns on all exported functions, methods,
trait methods (default impls, impls), that are not `#[inline]`.

Closes #1503.
2018-07-04 13:50:39 +02:00
Oliver Schneider
b4b6e6558e Version bump 2018-06-29 10:22:01 +02:00
Mateusz Mikuła
a24f77f65a Bump the version 2018-06-29 09:55:20 +02:00
Oliver Schneider
9f8624e5bf Version bump 2018-06-25 18:18:50 +02:00
Oliver Schneider
7d672888fe Version bump 2018-06-19 09:56:37 +02:00
Mateusz Mikuła
8625cfb988 Version bump 2018-06-18 09:56:58 +02:00
Oliver Schneider
8fe90e41d0 Publish preparation 2018-06-10 06:22:07 +02:00
Oliver Schneider
1c6c79f92c Version bump 2018-06-03 08:59:10 +02:00
Oliver Schneider
ce229b2025 Version bump 2018-05-29 11:58:58 +02:00
Reiner Dolp
78b8d5cf1a running update lints script 2018-05-27 16:16:41 +02:00
Oliver Schneider
fc008aa14c Rustup 2018-05-26 10:23:34 +02:00
Michael A. Plikk
77794e91e2 Create lint for unimplemented!() 2018-05-24 10:04:18 +02:00
Oliver Schneider
e7a3e03c6e Version bump 2018-05-23 16:38:19 +02:00
Oliver Schneider
0a368b467e
Update CHANGELOG.md 2018-05-20 14:09:39 +02:00
Oliver Schneider
0bf96259f1 Version bump 2018-05-20 10:02:29 +02:00
Oliver Schneider
ebe0b0eed5 Version bump 2018-05-19 13:01:26 +02:00
Oliver Schneider
c0bf3a4696 Version bump 2018-05-17 11:40:12 +02:00
Oliver Schneider
c658fc8cbc
Version bump 2018-05-14 11:29:22 +02:00
Oliver Schneider
a8d7e5a1f2
Version bump 2018-05-13 11:16:07 +02:00
Oliver Schneider
6baca22e27
Version bump 2018-05-11 09:56:57 +02:00
Oliver Schneider
e456241f18
Version bump 2018-05-07 10:00:58 +02:00
Oliver Schneider
642baa91cf
Version bump 2018-05-04 15:54:56 +02:00
Mateusz Mikuła
cc7d66aa9c rustup 2018-04-27 14:00:43 +02:00
Oliver Schneider
c5b39a5917
Version bump 2018-04-19 08:36:22 +02:00
Oliver Schneider
ae3213747d
Merge pull request #1467 from philipturnbull/option_map_nil_fn
Lint `Option.map(f)` where f returns unit
2018-04-15 16:14:25 +02:00
Oliver Schneider
9dc9487567
Version bump 2018-04-15 15:01:48 +02:00
Philipp Hansch
4f4e20c561
Also lint Result.map for unit returns 2018-04-15 13:59:57 +02:00
Philipp Hansch
a3ff21f4d6
Rename lint to option_map_unit_fn
Rust does not have nil.
2018-04-15 13:01:09 +02:00
Phil Turnbull
e5ecbb55ee
Lint Option.map(f) where f returns nil 2018-04-15 13:01:09 +02:00
Oliver Schneider
4015395888
Version bump 2018-04-08 11:13:46 +02:00
Manish Goregaokar
d71f918616 Update changelog 2018-04-04 17:59:54 -07:00
Manish Goregaokar
1d5dc3d180 Update changelog for 0.191 2018-03-30 10:38:35 +02:00
Oliver Schneider
96d5af36f8
Version bump 2018-03-27 12:14:46 +02:00
Oliver Schneider
47a706682c
Version bump 2018-03-19 09:26:05 +01:00
Oliver Schneider
8749927973
Rustup 2018-03-16 09:44:20 +01:00
Manish Goregaokar
539b4b61ec Bump to 0.0.187 2018-02-26 12:32:18 -08:00
Oliver Schneider
ce47e529d2
Version Bump 2018-02-05 08:48:40 +01:00
Manish Goregaokar
8e8cf2feb1 Bump to 0.0.185 2018-02-02 13:23:32 +05:30
Oliver Schneider
8123495e0f
Version bump 2018-01-30 15:02:47 +01:00
Manish Goregaokar
81c5a05648
Bump to 0.0.183 2018-01-29 11:20:29 +05:30
Oliver Schneider
930a8c6cab
Version Bump 2018-01-25 08:58:47 +01:00
Manish Goregaokar
96cba36b46
Rustup to rustc 1.25.0-nightly (97520ccb1 2018-01-21) 2018-01-22 10:35:02 +05:30
Ryan Cumming
5f3c340bfb Lint for trait methods without bodies
As discussed in rust-lang/rust#47475 the #[inline] attribute is
currently allowed on trait methods without bodies (i.e. without a
default implementation). This is misleading as it could be interpreted
as affecting the implementations of the trait method. Add a lint for any
use of #[inline] on a trait method without a body.

Fixes rust-lang/rust#47475
2018-01-18 20:01:24 +11:00
Oliver Schneider
d011dae96d
Rustup 2018-01-15 12:08:17 +01:00
Oliver Schneider
41a710e3f4
Version bump 2018-01-10 09:50:58 +01:00
Oliver Schneider
18f3f0dd62
Version bump 2018-01-08 11:43:01 +01:00
Manish Goregaokar
fae8a763f8
Bump to 0.0.177 2017-12-21 20:56:26 -08:00
Oliver Schneider
8ddcb81a15
Rustup and lazy_static version mismatch fix
fixes #2274
2017-12-15 10:05:32 +01:00