about summary refs log tree commit diff
path: root/clippy_lints
AgeCommit message (Collapse)AuthorLines
2019-08-05Auto merge of #4337 - flip1995:let_unit, r=phanschbors-10/+12
Make let_unit lint suggestion auto applicable changelog: Make `let_unit` lint suggestion auto applicable
2019-08-05Make let_unit lint suggestion auto applicableflip1995-10/+12
2019-08-05Rustup to https://github.com/rust-lang/rust/pull/63213Philipp Hansch-7/+7
2019-08-03Doctests: Enable running doc tests for restriction lintsPhilipp Hansch-16/+57
2019-08-03Doctests: Enable running doc tests for nursery lintsPhilipp Hansch-10/+29
2019-08-03Doctests: Enable running doc tests for pedantic lintsPhilipp Hansch-27/+73
2019-08-03Auto merge of #4327 - phansch:doctests_perf, r=flip1995bors-32/+65
Doctests: Enable running doc tests for perf lints changelog: none This should be possible to merge independently of #4325 cc #4319
2019-08-03Auto merge of #4325 - phansch:doctests_complexity, r=flip1995bors-85/+157
Doctests: Enable running doc tests for complexity lints changelog: none master: `113 passed; 0 failed; 91 ignored; 0 measured; 0 filtered out` this PR: `181 passed; 0 failed; 110 ignored; 0 measured; 0 filtered out` cc #4319
2019-08-03Rustup to latest rustc masterPhilipp Hansch-7/+9
Broken due to: * https://github.com/rust-lang/rust/pull/63180 (`Existential` -> `OpaqueTy`) * https://github.com/rust-lang/rust/pull/63121 (New fields for `FormatSpec`)
2019-08-03Also enable doc tests for internal lintsPhilipp Hansch-2/+2
Because there were fixed in the parent commit.
2019-08-03Doctests: Enable running doc tests for perf lintsPhilipp Hansch-32/+65
This should be possible to merge independently of #4325 cc #4319
2019-08-02Doctests: Fix all complexity lint docsPhilipp Hansch-83/+155
cc #4319
2019-08-01Auto merge of #4322 - Y0hy0h:patch-1, r=phanschbors-1/+10
Improve documentation on implicit_hasher lint Provide an example of how to fix the implicit_hasher lint. Fixes #3475. changelog: none
2019-08-01Fix missing importY0hy0h-1/+1
2019-08-01Auto merge of #4314 - chansuke:add-negation-to-is_empty, r=flip1995bors-1/+1
Add negation to `len_zero` lint to show more explicit message. Fixes #4304 I have updated the `len_zero` to show the required negation in case of like the below case. ``` fn main() { let v = vec![1]; if v.len() > 0 { } } ``` changelog: Clarify suggestion of `len_zero` lint.
2019-08-01Fix doc testsflip1995-0/+6
2019-08-01Remove Known problems for UNNECESSARY_UNWRAPflip1995-1/+1
This shouldn't happen with NLL
2019-08-01Move UNNECESSARY_UNWRAP to complexity and PANICKING_UNWRAP to correctnessflip1995-4/+6
2019-08-01Auto merge of #4318 - izik1:typo, r=phanschbors-2/+2
Fix `for on` typo <!-- 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. - [ ] Followed [lint naming conventions][lint_naming] - [ ] Added passing UI tests (including committed `.stderr` file) - [ ] `cargo test` passes locally - [ ] Executed `util/dev update_lints` - [ ] Added lint documentation - [ ] Run `cargo fmt` 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 --> closes #4317 changelog: minor typo fix
2019-08-01Improve documentation on implicit_hasher lintY0hy0h-1/+10
Provide an example of how to fix the lint.
2019-08-01Auto merge of #4315 - phansch:fn_to_numeric_cast_applicability, r=flip1995bors-1/+1
Mark `fn_to_numeric_cast` lints as MaybeIncorrect At least for now so that `cargo fix --clippy` is not causing problems with this lint. See #3896 for the remaining problems with the suggestions of this lint. changelog: none cc #3630, #3896
2019-07-31Fix `for on` typoZachery Gyurkovitz-2/+2
2019-08-01Update formattingMichael Wright-13/+11
2019-07-31Mark `fn_to_numeric_cast` lints as MaybeIncorrectPhilipp Hansch-1/+1
At least for now so that `cargo fix --clippy` is not causing problems with this lint. cc #3630, #3896
2019-08-01Add required negation in non_zero lintchansuke-1/+1
2019-07-31Update all the code to pass the updated `use_self` lint.Jakub Wieczorek-77/+78
One struct required a temporary `#[allow(dead_code)]` annotation due to a bug in the Rust compiler: https://github.com/rust-lang/rust/issues/63151.
2019-07-31Extend the `use_self` lint to suggest uses of `Self::Variant`.Jakub Wieczorek-20/+38
2019-07-30Auto merge of #3766 - xd009642:issue-3764, r=flip1995bors-3/+183
trait bounds lint - repeated types This PR is to tackle https://github.com/rust-lang/rust-clippy/issues/3764 it's still a WIP and doesn't work but this is an initial stab. It builds though I haven't added any tests as I'm not sure where lint tests should go? Unfortunately, it seems id isn't tied to the type itself but I guess where it is in the AST? Looking at https://manishearth.github.io/rust-internals-docs/syntax/ast/struct.Ty.html I can't see any members that would let me tell if a type was repeated in multiple trait bounds. There may be other issues with how I've implemented this so any assistance is appreciated! changelog: Add new lint: `type_repetition_in_bounds`
2019-07-30Fix breakage due to rust-lang/rust#61856Michael Wright-3/+18
2019-07-28Fix dogfood testxd009642-7/+3
2019-07-27Hash discriminant of lifetime.namexd009642-0/+1
2019-07-27Hash discriminant of Lifetime::Namexd009642-1/+2
2019-07-27Respond to review commentsxd009642-27/+26
Update README and CHANGELOG using the util scripts, refine the help message and fix the float_cmp error.
2019-07-27Added doc comment fixed type printoutxd009642-2/+16
Added a doc comment for the lint and fixed the printout of the type so it prints T not type(T)
2019-07-27Respond to comments and improve printoutxd009642-8/+8
Now get the trait names for the diagnostic message and removed more `let c: fn(_) -> _ = T; hashes from hir_utils
2019-07-26rustup https://github.com/rust-lang/rust/pull/62964Matthias Krüger-1/+1
2019-07-26Responded to comments and fixed compile bugxd009642-5/+3
Removed the hash of `let c: fn(_,_) -> _ = ExprKind::Cast` and fixed compile issue by collecting HirVec into an actual Vec
2019-07-24Fixed more compile errorsxd009642-10/+14
Moved to rustc::hir::Ty
2019-07-24Fix some of the compile errorsxd009642-32/+22
2019-07-24Changed Ty to ty, added lifetime 'tcxxd009642-17/+17
2019-07-24Lint for type repetition in trait bounds.xd009642-4/+181
This lint adds warning if types are redundantly repeated in trait bounds i.e. `T: Copy, T: Clone` instead of `T: Copy + Clone`. This is a late pass trait lint and has necessitated the addition of code to allow hashing of TyKinds without taking into account Span information.
2019-07-24rustup https://github.com/rust-lang/rust/pull/62859Matthias Krüger-1/+1
2019-07-23Auto merge of #4266 - uHOOCCOOHu:fix/async_fn_lifetime, r=flip1995bors-0/+2
Ignore generated fresh lifetimes in elision check <!-- 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. - [ ] Followed [lint naming conventions][lint_naming] - [ ] Added passing UI tests (including committed `.stderr` file) - [ ] `cargo test` passes locally - [ ] Executed `util/dev update_lints` - [ ] Added lint documentation - [ ] Run `cargo fmt` 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 --> fixes #3988 changelog: Ignore generated fresh lifetimes in elision check. **HELP**: It seems `tests/ui` are compiled under edition 2015, and I don't know how to add tests for this properly. Here is the test input it had already passed: ```rust #![feature(async_await)] #![allow(dead_code)] async fn sink1<'a>(_: &'a str) {} // lint async fn sink1_elided(_: &str) {} // ok async fn one_to_one<'a>(s: &'a str) -> &'a str { s } // lint async fn one_to_one_elided(s: &str) -> &str { s } // ok async fn all_to_one<'a>(a: &'a str, _b: &'a str) -> &'a str { a } // ok // async fn unrelated(_: &str, _: &str) {} // Not allowed in async fn // #3988 struct Foo; impl Foo { pub async fn foo(&mut self) {} // ok } // rust-lang/rust#61115 async fn print(s: &str) { // ok println!("{}", s); } fn main() {} ```
2019-07-21Fix breakage due to rust-lang/rust#60913Michael Wright-16/+30
2019-07-21Fix breakage due to rust-lang/rust#62705Michael Wright-7/+7
Also rename `OUTER_EXPN_INFO` to `OUTER_EXPN_EXPN_INFO` to match new function names.
2019-07-19Update pulldown-cmark to 0.5.3Philipp Hansch-1/+1
2019-07-18Auto merge of #4274 - daxpedda:implicit_return_fixes, r=flip1995bors-63/+91
false positives fixes of `implicit_return` - Handle returning macro statements properly (remove "this error originates in a macro outside of the current crate") - Handle functions that return never type - Handle functions that panic but do not return never type changelog: Fix false positives in `implicit_return` lint pertaining to macros and panics
2019-07-18Format codeflip1995-0/+1
2019-07-17Improved importsdaxpedda-2/+2
2019-07-17Corrections for PR review.Darth-Revan-11/+17