about summary refs log tree commit diff
path: root/clippy_lints/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2020-02-04Use span_lint_and_sugg + move infaillible lintThibsG-8/+6
- moving infaillible lint to prevent collisions
2020-02-04Add new lint: match with a single binding statementThibsG-0/+3
- Lint name: MATCH_SINGLE_BINDING
2020-02-02Rustup to rust-lang/rust#68133Yuki Okushi-0/+4
2020-01-31Move debug_assertions_with_mut_call to nurseryflip1995-2/+1
2020-01-30add lintMikhail Babenko-0/+3
2020-01-30Declare lint and implement lint logic.xiongmao86-0/+5
2020-01-25Auto merge of #5081 - Areredify:vec_box_threshold, r=flip1995bors-1/+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-1/+2
2020-01-23add `option_as_ref_deref` lintAreredify-0/+3
2020-01-20Add `skip_while_next` lintYuki Okushi-0/+3
2020-01-19Run `update_lints`Yuki Okushi-3/+3
2020-01-19Rename `ok_if_let` to `if_let_some_result`Yuki Okushi-5/+5
2020-01-18rustup https://github.com/rust-lang/rust/pull/67712Matthias Krüger-1/+0
slice_patterns have been stabilized.
2020-01-18Downgrade range_plus_one to pedanticAndre Bogus-2/+1
2020-01-15Add lint for default lint descriptionBrad Sherman-0/+1
- Lint for any new lints that have the default lint description from the automation
2020-01-13Auto merge of #4543 - xiongmao86:issue4503, r=flip1995bors-0/+2
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-13Rustup to rust-lang/rust#68045Yuki Okushi-5/+7
2020-01-12./util/dev update_lints.xiongmao86-2/+1
2020-01-12Declare lint.xiongmao86-0/+3
2020-01-09Auto merge of #4960 - ThibsG:patterns_with_wildcard_#4640, r=flip1995bors-0/+3
New lint: pats_with_wild_match_arm Wildcard use with other pattern in same match arm. The wildcard covers other(s) pattern(s) as it will match anyway. changelog: add new lint when multiple patterns (including wildcard) are used in a match arm. Fixes #4640.
2020-01-07Move `transmute_float_to_int` lint to `complexity`Krishna Sai Veera Reddy-1/+2
`transmute_float_to_int` lint was accidentally added to nursery so moving it to the complexity group.
2020-01-07Change lint name to WILDCARD_IN_OR_PATTERNSThibsG-3/+3
2020-01-07Move to complexity and adapt testThibsG-1/+2
- test wildcard_enum_match_arm has been impacted by this new lint
2020-01-07New lint: pats_with_wild_match_armThibsG-0/+2
- Wildcard use with other pattern in same match arm
2020-01-06Add lint to detect usage of invalid atomic orderingKrishna Sai Veera Reddy-0/+5
Detect usage of invalid atomic ordering modes such as `Ordering::{Release, AcqRel}` in atomic loads and `Ordering::{Acquire, AcqRel}` in atomic stores.
2020-01-07Rustup to rust-lang/rust#67886Yuki Okushi-0/+2
2020-01-04Add lint for iter.nth(0)Brad Sherman-0/+3
- Encourage iter.next() rather than iter.nth(0), which is less readable
2019-12-31Move `mem_replace_with_default` out of nurseryKrishna Veera Reddy-1/+2
2019-12-31Use `mem::take` instead of `mem::replace` when applicableKrishna Veera Reddy-0/+2
`std::mem::take` can be used to replace a value of type `T` with `T::default()` instead of `std::mem::replace`.
2019-12-31Rustup to rust-lang/rust#67707Yuki Okushi-2/+2
2019-12-28Add new lint (modulo_arithmetic)mgr-inz-rafal-0/+4
2019-12-24Auto merge of #4885 - rust-lang:mut-key-types, r=flip1995bors-0/+5
new lint: mutable_key_type This fixes #732 - well, partly, it doesn't adress `Hash` impls, but the use of mutable types as map keys or set members changelog: add `mutable_key_type` lint r? @flip1995
2019-12-24new lint: mutable_key_typeAndre Bogus-0/+5
2019-12-24do minor cleanupsLzu Tao-5/+6
* ToString and AsRef are in prelude, no need to import them
2019-12-22implemented `let_underscore` lintMikhail Babenko-0/+4
actually add files update lints change to pedantic
2019-12-21Deprecate unused_label lintflip1995-5/+4
This lint was uplifted/turned into warn-by-default in rustc
2019-12-18Update iterator_step_by_zeroMichael Wright-3/+3
Move `iterator_step_by_zero` into `methods` since it applies to all iterators and not just ranges. Simplify the code while doing so.
2019-12-16Fix clippy build failureKrishna Veera Reddy-1/+0
Clippy build fails because the feature `result_map_or` has been stabilized in v1.41.0 but we still have an explicit feature attribute for it.
2019-12-07Add lint to detect transmutes from float to integerKrishna Veera Reddy-0/+2
Add lint that detects transmutation from a float to an integer and suggests usage of `{f32, f64}.to_bits()` instead.
2019-12-06Add lint for pub fns returning a `Result` without documenting errorsRobbieClarken-0/+2
The Rust Book recommends that functions that return a `Result` type have a doc comment with an `# Errors` section describing the kind of errors that can be returned (https://doc.rust-lang.org/book/ch14-02-publishing-to-crates-io.html#commonly-used-sections). This change adds a lint to enforce this. The lint is allow by default; it can be enabled with `#![warn(clippy::missing_errors_doc)]`. Closes #4854.
2019-12-04Rustup to rust-lang/rust#66878Matthias Krüger-1/+5
2019-11-29Add custom ICE message that points to Clippy repoPhilipp Hansch-0/+2
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-29Run update_lintsflip1995-1/+1
2019-11-28Auto merge of #4821 - Areredify:as_conversions, r=flip1995bors-0/+4
Add `as_conversions` lint changelog: closes #4771, adding a new pedantic allow-by-default lint that lints against any usage of `as`.
2019-11-28make use of Result::map_orLzu Tao-0/+1
2019-11-25implemented `as_conversions` lintMikhail Babenko-0/+4
actuall add files add better example and change pedantic to restriction
2019-11-23Run update_lintsflip1995-2/+2
2019-11-23Merge remote-tracking branch 'FlorianRohm/issue/4623' into rollup-new-lintsflip1995-0/+5
2019-11-23Merge remote-tracking branch 'Areredify/large_stack_arrays' into ↵flip1995-0/+5
rollup-new-lints
2019-11-23Merge remote-tracking branch 'popzxc/if-same-cond-fn' into rollup-new-lintsflip1995-0/+2