about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2019-12-12Auto merge of #4883 - ↵bors-10/+64
krishna-veerareddy:issue-4818-cast-sign-loss-false-positive, r=flip1995 Fix false positive with cast_sign_loss lint `cast_sign_loss` lint incorrectly suggests that the result of `checked_abs`, `rem_euclid` and `checked_rem_euclid` cannot be casted to an unsigned integer without loss. Fixes #4818 #4764 #4743 changelog: Fix false positives in `cast_sign_loss` lint
2019-12-11Auto merge of #4886 - rust-lang:must-use-pub-only, r=phanschbors-0/+1
Lint only exported must_use_candidates As promised on #4779, here's the check for publicly visible items for `must_use_candidate` changelog: none
2019-12-08Auto merge of #4889 - krishna-veerareddy:issue-3993-float-to-int-transmute, ↵bors-2/+131
r=llogiq Add lint to detect transmutes from float to integer Add lint that detects transmutation from a float to an integer and suggests usage of `{f32, f64}.to_bits()` instead. Fixes #3993 changelog: Add lint `transmute_float_to_int`
2019-12-07Move `transmute_float_to_int` test cases into separate fileKrishna Veera Reddy-57/+61
`transmute.stderr` file line count exceeded due to the new test cases so moving the new test cases into a separate file.
2019-12-07Add lint to detect transmutes from float to integerKrishna Veera Reddy-11/+136
Add lint that detects transmutation from a float to an integer and suggests usage of `{f32, f64}.to_bits()` instead.
2019-12-06Lint only exported must_use_candidatesAndre Bogus-0/+1
2019-12-06Auto merge of #4884 - RobbieClarken:warn-missing-errors, r=llogiqbors-47/+202
Add lint for pub fns returning a `Result` without documenting errors The Rust Book recommends that functions that return a `Result` type have [a doc comment with an `# Errors` section](https://doc.rust-lang.org/book/ch14-02-publishing-to-crates-io.html#commonly-used-sections) describing the kind of errors that can be returned. 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. changelog: adds lint for `missing_errors_doc`
2019-12-06Add lint for pub fns returning a `Result` without documenting errorsRobbieClarken-47/+202
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-05Add widening tests for `cast_sign_loss` lintKrishna Veera Reddy-0/+20
2019-12-05Fix false positive with cast_sign_loss lintKrishna Veera Reddy-10/+44
`cast_sign_loss` lint incorrectly suggests that the result of `checked_abs`, `rem_euclid` and `checked_rem_euclid` cannot be casted to an unsigned integer without loss.
2019-12-05Auto merge of #4880 - daxpedda:string-add, r=phanschbors-5/+24
Fix false positive in `string_add`. `clippy::string_add` was popping up in macros. I'm not sure what clippy's general direction is in these matters, but I can change it to be external macros only too. --- changelog: Fix false positives for `string_add` in macro expansions.
2019-12-05Change to only detect in external macros.daxpedda-17/+21
2019-12-04Fix false positive in `string_add`.daxpedda-1/+16
2019-12-04Auto merge of #4879 - matthiaskrgr:rustup_23, r=flip1995bors-151/+308
Rustup to rust-lang/rust#66878 I need to sleep now, feel free to pick it up. The output of the `lint_without_lint_pass` test seems to disappear, I'm not sure why.. :/ changelog: none
2019-12-04Rustup to rust-lang/rust#66878Matthias Krüger-151/+308
2019-12-03Auto merge of #4877 - flip1995:manual_swap_4853, r=llogiqbors-58/+196
Fix FP in manual_swap lint with slice-like types Fixes #4853 changelog: Fix FP in [`manual_swap`] lint with slice-like types and make it auto applicable
2019-12-03Auto merge of #4878 - flip1995:rustup, r=flip1995bors-26/+18
Rustup Included rustups: - rust-lang/rust#66935 (syntax: Unify macro and attribute arguments in AST) - rust-lang/rust#66941 (Remove `ord` lang item) Fixes? #2597 changelog: none
2019-12-03Update op_ref.stderrflip1995-9/+1
2019-12-03Make OP_REF lint suggestion MaybeIncorrectflip1995-2/+2
cc #2597
2019-12-03Fire clippy::op_ref on PartialOrd but !Ord typesChristopher Durham-1/+1
2019-12-03Rustup to rust-lang/rust#66935flip1995-14/+14
2019-12-03Fix rustdoc examplesflip1995-0/+2
2019-12-03Make manual_swap autofixableflip1995-13/+100
2019-12-03Formattingflip1995-25/+34
2019-12-03Fix FP in manual_swap lint with slice-like typesflip1995-24/+55
2019-12-03Add regression test for manual_swapflip1995-5/+14
2019-12-02Auto merge of #4875 - flip1995:rustup, r=matthiaskrgrbors-2/+4
Rustup to rust-lang/rust#64736 cc rust-lang/rust#64736 Fixes #4872 changelog: none
2019-12-02Normalize custom ICE testflip1995-0/+1
Fixes #4872
2019-12-02Rustup to rust-lang/rust#64736flip1995-2/+3
2019-12-02Auto merge of #4873 - phansch:rustup2, r=eddybbors-5/+6
Rustup to https://github.com/rust-lang/rust/pull/66789 changelog: none
2019-12-02Use assert_crate_local for a more explicit errorPhilipp Hansch-5/+5
`assert_crate_local` does the same as the previous `if let` but with a more explicit error message if it's not a `ClearCrossCrate::Set`.
2019-12-02Rustup to https://github.com/rust-lang/rust/pull/66789Philipp Hansch-2/+3
2019-12-01Auto merge of #4690 - lzutao:fix-test-on-non-amd64, r=flip1995bors-101/+506
generate stderr file on 32bit pointer system changelog: none
2019-12-01Auto merge of #4870 - lzutao:check-macro-missing_inline_in_public_items, ↵bors-3/+7
r=flip1995 account for external macro in MISSING_INLINE_IN_PUBLIC_ITEMS lint Closes #4861 changelog: Fix FP (external macro) in [`missing_inline_in_public_items`] lint
2019-12-01account for external macro in MISSING_INLINE_IN_PUBLIC_ITEMS lintLzu Tao-3/+7
2019-12-01build(tests/fmt): use shared target dirLzu Tao-1/+3
2019-12-01chore: fix and split some ui tests on 32bit systemLzu Tao-87/+482
2019-12-01build: set up build job for i686 targetsLzu Tao-6/+18
2019-12-01remove needless my_lint ui testLzu Tao-7/+0
2019-12-01git quietLzu Tao-0/+3
2019-12-01Auto merge of #4866 - rust-lang:needful-doctest-main, r=flip1995bors-1/+44
Less needless_doctest_main false positives This checks if a) the `fn main() {}` function is empty or if the doctest contains a `static`. In both cases don't lint. While this fixes #4858 at the cost of some false negatives, but this seems a better solution than disabling the lint outright. In the long run, using `syn` should solve the issue in the right way. changelog: none
2019-11-30Auto merge of #4868 - lzutao:deploy-in-dir, r=phanschbors-0/+1
deploy: cd to out/ before adding files to git It should work now: https://travis-ci.com/lzutao/rust-clippy/jobs/261801929 Closes #4785 changelog: none
2019-11-30deploy: cd to out/ before adding files to gitLzu Tao-0/+1
2019-11-30Auto merge of #4865 - phansch:fix_master_deployment, r=llogiqbors-0/+1
Fix master deployment It was failing because it could not find `.github/deploy_key.enc` in the current directory (`./out`). Switching to the previous directory should fix the deployment and the master build. Example Travis log: https://travis-ci.com/rust-lang/rust-clippy/jobs/261688169#L1900 changelog: none cc @lzutao
2019-11-29Less needless_doctest_main false positivesAndre Bogus-1/+44
This checks if a) the `fn main() {}` function is empty or if the doctest contains a `static`. In both cases don't lint.
2019-11-29Auto merge of #4588 - phansch:add_custom_ice_hook, r=Manishearthbors-1/+126
Add custom ICE message that points to Clippy repo changelog: Link to Clippy issue tracker in ICE messages 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-29fmtPhilipp Hansch-1/+1
2019-11-29Feed the dogPhilipp Hansch-1/+1
2019-11-29Use rustc_env instead of exec_env for testPhilipp Hansch-3/+3
2019-11-29Make triggering this lint less likely :paperclip:Philipp Hansch-2/+2