about summary refs log tree commit diff
path: root/clippy_lints/src/utils
AgeCommit message (Collapse)AuthorLines
2020-02-02Rustup to rust-lang/rust#68133Yuki Okushi-2/+2
2020-01-30lint all guard types, not just lock functionsAreredify-3/+3
2020-01-30add lintMikhail Babenko-0/+3
2020-01-27Rename `span_note_and_lint` to `span_lint_and_note`Yuki Okushi-2/+2
2020-01-27Rename `span_help_and_lint` to `span_lint_and_help`Yuki Okushi-4/+4
2020-01-26Don't use ExpnKind::descr to get the name of a bang macro.Eduard-Mihai Burtescu-13/+13
2020-01-25Auto merge of #5081 - Areredify:vec_box_threshold, r=flip1995bors-0/+2
add size parameter for `vec_box` lint changelog: add size threshold for the `vec_box` lint, currently 4096 bytes (one page) (subject to change). Closes #3547. diff is a little bit confusing due to some refactoring (moving free functions to lint struct functions), relevant portion is [this](https://github.com/rust-lang/rust-clippy/compare/master...Areredify:vec_box_threshold?expand=1#diff-1096120ca9143af89dcc9175ea92b54aR294-R298). In hindsight should've been different commits, but oh well.
2020-01-25add size parameter for lintMikhail Babenko-0/+2
2020-01-24don't fire empty_loop in no_std cratesMikhail Babenko-1/+11
2020-01-23add `option_as_ref_deref` lintAreredify-0/+8
2020-01-22Rustup to rust-lang/rust#68140Yuki Okushi-1/+1
2020-01-18Rustup to rust-lang/rust#68204Yuki Okushi-4/+12
2020-01-15Add lint for default lint descriptionBrad Sherman-4/+49
- Lint for any new lints that have the default lint description from the automation
2020-01-15Auto merge of #5034 - ThibsG:MatchWildErrArmImprove5024, r=flip1995bors-0/+43
Match wild err arm improvements This lint should trigger on other identifiers which have `_` prefix (such as `_e`) and only if they are unused in the panic block. _Note_: the `is_unused` function is greatly inspired from `pat_is_wild` function in [loops lints](https://github.com/rust-lang/rust-clippy/blob/43ac9416d935942d6c7d2b2e0c876c551652c4ec/clippy_lints/src/loops.rs#L1689). I've been considering doing some refactoring, maybe in utils. Maybe this PR or a new one. What do you think ? fixes #5024 changelog: none
2020-01-13Auto merge of #4543 - xiongmao86:issue4503, r=flip1995bors-0/+1
Fix issue4503 Fixes #4503. changelog: Add a lint checking user are using FileType.is_file() method and suggest using !FileType.is_dir(). - [x] Followed [lint naming conventions][lint_naming] - [x] Added passing UI tests (including committed `.stderr` file) - [x] `cargo test` passes locally - [x] Executed `./util/dev update_lints` - [x] Added lint documentation - [x] Run `./util/dev fmt`
2020-01-13Extract visitor to utilsThibsG-0/+43
2020-01-13Rustup to rust-lang/rust#68045Yuki Okushi-10/+10
2020-01-12Add lint logic.xiongmao86-0/+1
2020-01-11Rustup to rust-lang/rust#67806Yuki Okushi-8/+6
2020-01-11Apply review commentsYuki Okushi-11/+5
2020-01-11Rustup to rust-lang/rust#68101Yuki Okushi-2/+1
2020-01-11Rustup to rust-lang/rust#67258Yuki Okushi-5/+16
2020-01-09Rustup to rust-lang/rust#67979Yuki Okushi-8/+20
2020-01-08Fix useless attribute suggestionflip1995-2/+11
2020-01-08Rustup to rust-lang/rust#67970Yuki Okushi-1/+3
2020-01-07Make utils::remove_blocks non-recursiveLzu Tao-6/+5
2020-01-07Rustup to rust-lang/rust#67886Yuki Okushi-24/+25
2020-01-04Rustup to https://github.com/rust-lang/rust/pull/67853Philipp Hansch-8/+9
Specifically caused by https://github.com/rust-lang/rust/pull/67786
2020-01-03No #[no_mangle] must_use_candidate functionsAndre Bogus-6/+9
2020-01-02Move `is_normalizable` into utilsYuki Okushi-0/+9
2019-12-31Rustup to rust-lang/rust#67707Yuki Okushi-5/+5
2019-12-30Rustup to rust-lang/rust#66942Yuki Okushi-34/+34
2019-12-27Rustup to rust-lang/rust#66936Yuki Okushi-101/+130
2019-12-24rustup "Add span information to `ExprKind::Assign`"Lzu Tao-5/+8
2019-12-24do minor cleanupsLzu Tao-4/+0
* ToString and AsRef are in prelude, no need to import them
2019-12-23Auto merge of #4823 - Areredify:must_use_res, r=flip1995bors-1/+69
Add `let_underscore_must_use` lint changelog: closes #4812 , added a new `let_underscore_must_use` lint, moved `is_must_use_ty` to utils, added `is_must_use_fn` util function
2019-12-23a few small cleanupsLzu Tao-11/+7
2019-12-22implemented `let_underscore` lintMikhail Babenko-1/+23
actually add files update lints change to pedantic
2019-12-22move is_must_use_ty to utilsMikhail Babenko-1/+47
2019-12-22Add <'_> where necessaryflip1995-13/+13
2019-12-21rustup "Merge `ast::Mutability` and `mir::Mutability`"Lzu Tao-2/+2
2019-12-04Rustup to rust-lang/rust#66878Matthias Krüger-4/+7
2019-11-29fmtPhilipp Hansch-1/+1
2019-11-29Make triggering this lint less likely :paperclip:Philipp Hansch-1/+1
2019-11-29Add custom ICE message that points to Clippy repoPhilipp Hansch-0/+39
This utilizes https://github.com/rust-lang/rust/pull/60584 by setting our own `panic_hook` and pointing to our own issue tracker instead of the rustc issue tracker. This also adds a new internal lint to test the ICE message. **Potential downsides** * This essentially copies rustc's `report_ice` function as `report_clippy_ice`. I think that's how it's meant to be implemented, but maybe @jonas-schievink could have a look as well =) The downside of more-or-less copying this function is that we have to maintain it as well now. The original function can be found [here][original]. * `driver` now depends directly on `rustc` and `rustc_errors` Closes #2734 [original]: https://github.com/rust-lang/rust/blob/59367b074f1523353dddefa678ffe3cac9fd4e50/src/librustc_driver/lib.rs#L1185
2019-11-29Use infer_ctxtflip1995-9/+4
2019-11-28Fix categorizationsManish Goregaokar-7/+6
2019-11-28Fix arguments on ExprUseVisitor::newManish Goregaokar-2/+0
2019-11-28euv moved from middle to typeckManish Goregaokar-3/+1
2019-11-28cmt_ -> PlaceManish Goregaokar-4/+4