about summary refs log tree commit diff
path: root/clippy_lints
AgeCommit message (Collapse)AuthorLines
2019-10-24Update clippy for latest rustc changesMark Rousskov-796/+1124
Specifically, this revises the clippy integration to utilize a new callback to register its lints, as the prior editing of lint store in Session is no longer possible.
2019-10-24Don't emit try_err lint in external macrosPhilipp Hansch-1/+2
2019-10-23Auto merge of #4680 - hellow554:debug_assert_mut_call, r=flip1995bors-0/+159
Add lint for debug_assert_with_mut_call closes #1526 **What does not work:** * detecting a mut call in the format string itself, e.g. `debug_assert!(false, "{}", vec![1].pop())` * detecting `*mut T` usage (pointer) --- changelog: add new lint `debug_assert_with_mut_call`
2019-10-23Auto merge of #4691 - HMPerson1:suggest_iter, r=phanschbors-18/+59
Fix suggestion of `explicit_counter_loop` changelog: In the suggestion of `explicit_counter_loop`, if the `for` loop argument doesn't implement `Iterator`, then we suggest `x.into_iter().enumerate()` (or `x.iter{_mut}()` as appropriate). Also, the span of the suggestion has been corrected. Fixes #4678
2019-10-23deps: update cargo_metadata from 0.8.0 to 0.9.0Matthias Krüger-2/+2
2019-10-22Use StableHasher in SpanlessHasherflip1995-8/+11
2019-10-22Don't hash spans in SpanlessHasherflip1995-2/+2
2019-10-22Add lint for debug_assert_with_mut_callMarcel Hellwig-0/+159
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-19rustup https://github.com/rust-lang/rust/pull/65535Lzu Tao-2/+2
2019-10-18Fix suggestion for rangesHMPerson1-3/+11
2019-10-18Omit proc macros from `must_use_candidate`Andre Bogus-5/+18
2019-10-18Split out testsHeinz N. Gies-3/+7
2019-10-18Add expectHeinz N. Gies-2/+87
Co-Authored-By: Philipp Krones <hello@philkrones.com>
2019-10-18Add todo and testsHeinz N. Gies-2/+24
2019-10-18add restirction for unreachable and panicHeinz Gies-2/+42
2019-10-18Fix suggestion span in `explicit_counter_loop`HMPerson1-1/+10
2019-10-18Suggest calling `iter` if needed in `explicit_counter_loop`HMPerson1-14/+38
2019-10-17Auto merge of #4683 - HMPerson1:inefficient_to_string, r=Manishearthbors-2/+87
Add `inefficient_to_string` lint Closes #4586 changelog: Add `inefficient_to_string` lint, which checks for calling `to_string` on `&&str`, which would bypass the `str`'s specialization
2019-10-17Update help text in `inefficient_to_string`Michael Zhang-1/+1
Co-Authored-By: Manish Goregaokar <manishsmail@gmail.com>
2019-10-17syntax::ext -> syntax_expandManish Goregaokar-4/+6
2019-10-16Dogfood for `inefficient_to_string`HMPerson1-2/+2
2019-10-16Add `inefficient_to_string` lintHMPerson1-0/+85
2019-10-15Rustup to rustc 1.40.0-nightly (237d54ff6 2019-10-15)Manish Goregaokar-4/+10
2019-10-15Fix ICE in use_self lintflip1995-1/+6
2019-10-15Change terminology from static to associatedJames Wang-2/+2
2019-10-15Switch to OnlyBodiesJames Wang-1/+1
2019-10-15Change lint to be pedanticJames Wang-4/+3
2019-10-15Remove printsJames Wang-2/+0
2019-10-15Add a new lint for unused selfJames Wang-57/+155
2019-10-14new lints around `#[must_use]` fnsAndre Bogus-29/+465
`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-10Use match_function_call wherever possibleMatthias Seiffert-42/+21
2019-10-10Move match_function_call to utilsMatthias Seiffert-21/+25
2019-10-09Auto merge of #4616 - mati865:license, r=Manishearthbors-2/+2
Fix license in Cargo.toml files Missed in https://github.com/rust-lang/rust-clippy/pull/3269 changelog: none r? @Manishearth
2019-10-09New lint: suspicious_unary_op_formattingNikos Filippakis-1/+66
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-09Auto merge of #4635 - Lythenas:suggestions-for-assert-false, r=flip1995bors-28/+126
Add assert message to suggestion in lint assertions_on_constants <!-- Thank you for making Clippy better! We're collecting our changelog from pull request descriptions. If your PR only updates to the latest nightly, you can leave the `changelog` entry as `none`. Otherwise, please write a short comment explaining your change. If your PR fixes an issue, you can add "fixes #issue_number" into this PR description. This way the issue will be automatically closed when your PR is merged. If you added a new lint, here's a checklist for things that will be checked during review or continuous integration. - [x] Followed [lint naming conventions][lint_naming] - [x] Added passing UI tests (including committed `.stderr` file) - [ ] `cargo test` passes locally - [x] Executed `./util/dev update_lints` - [ ] Added lint documentation - [ ] Run `./util/dev fmt` [lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints Note that you can skip the above if you are just opening a WIP PR in order to get feedback. Delete this line and everything above before opening your PR --> - [x] suggest replacing `assert!(false, "msg")` with `panic!("msg")` - [x] extend to allow ~~variables~~ any expression for `"msg"` - ~~suggest replacing `assert!(false, "msg {}", "arg")` with `panic!("msg {}", "arg")`~~ changelog: add assert message to suggestion in lint assertions_on_constants Work towards fixing: #3575
2019-10-08Addresses Issue #4001Ethan Lam-0/+110
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-08Auto merge of #4627 - kerhong:fix-typo-in-inherent-to-string, r=phanschbors-2/+2
Fix typo in inherent_to_string documentation A simple typo fix in `inherent_to_string` and `inherent_to_string_shadow_display` documentation changelog: none
2019-10-08Auto merge of #4611 - rust-lang:doc-visibility, r=flip1995bors-18/+70
account for doc visibility This fixes #4608. Also I noticed that the lint failed to look at trait and impl items. There's a small bit of fallout in the code, too, but not enough to warrant its own commit. changelog: check docs of trait items and impl items, also make `missing_safety_doc` account for visibility
2019-10-08Auto merge of #4592 - rust-lang:transmute-collection, r=flip1995bors-230/+302
New lint: `unsound_collection_transmute` changelog: Add `unsound_collection_transmute` lint This fixes #4515
2019-10-07Reduce duplicationMatthias Seiffert-64/+59
2019-10-07Match any expr for panic messageMatthias Seiffert-11/+9
2019-10-07Make if_chain more readableMatthias Seiffert-38/+55
2019-10-07Add message to replace assert!(false) helpMatthias Seiffert-5/+93
2019-10-06Move is_argument check into mutateflip1995-13/+15
2019-10-05Run util/dev fmtflip1995-35/+11
2019-10-05Get rid of rvalue_promotable_map method callflip1995-17/+10
2019-10-05Merge consume and consume_pat in escape analysisflip1995-45/+11
FIXME: This doesn't work and probably needs a rewrite of the lint See https://github.com/rust-lang/rust-clippy/pull/4628#issuecomment-538574944
2019-10-04Use new format of licensesMateusz Mikuła-2/+2
Co-Authored-By: lzutao <taolzu@gmail.com>
2019-10-04Fix needless_pass_by_valueflip1995-77/+7
This also accidentally improved the spans of the suggestions
2019-10-04Rustup to rust-lang/rust#64874flip1995-46/+20
Episode 1 - The simple cases