]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoDetect comparisons with NAN constants
Krishna Veera Reddy [Wed, 18 Dec 2019 02:51:30 +0000 (18:51 -0800)]
Detect comparisons with NAN constants

Currently `cmp_nan` lint doesn't detect comparisons with NaN's
if the operands are consts variables so to fix this we evaluate
the const variables first before testing for NaN.

4 years agoAuto merge of #4907 - krishna-veerareddy:fix-clippy-build, r=phansch
bors [Tue, 17 Dec 2019 09:00:51 +0000 (09:00 +0000)]
Auto merge of #4907 - krishna-veerareddy:fix-clippy-build, r=phansch

Fix clippy build failure

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.

changelog: none

4 years agoFix clippy build failure
Krishna Veera Reddy [Tue, 17 Dec 2019 06:29:05 +0000 (22:29 -0800)]
Fix clippy build failure

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.

4 years agoMerge pull request #4900 from Mark-Simulacrum/niko-no-never
Manish Goregaokar [Sun, 15 Dec 2019 01:40:33 +0000 (17:40 -0800)]
Merge pull request #4900 from Mark-Simulacrum/niko-no-never

Update tests for revert of never type stabilization

4 years agoUpdate tests for revert of never type stabilization
Mark Rousskov [Sat, 14 Dec 2019 13:40:43 +0000 (08:40 -0500)]
Update tests for revert of never type stabilization

4 years agoAuto merge of #4883 - krishna-veerareddy:issue-4818-cast-sign-loss-false-positive...
bors [Thu, 12 Dec 2019 00:34:59 +0000 (00:34 +0000)]
Auto merge of #4883 - 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

4 years agoAuto merge of #4886 - rust-lang:must-use-pub-only, r=phansch
bors [Wed, 11 Dec 2019 12:01:10 +0000 (12:01 +0000)]
Auto merge of #4886 - rust-lang:must-use-pub-only, r=phansch

Lint only exported must_use_candidates

As promised on #4779, here's the check for publicly visible items for `must_use_candidate`

changelog: none

4 years agoAuto merge of #4889 - krishna-veerareddy:issue-3993-float-to-int-transmute, r=llogiq
bors [Sun, 8 Dec 2019 02:23:23 +0000 (02:23 +0000)]
Auto merge of #4889 - krishna-veerareddy:issue-3993-float-to-int-transmute, 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`

4 years agoMove `transmute_float_to_int` test cases into separate file
Krishna Veera Reddy [Sun, 8 Dec 2019 00:59:17 +0000 (16:59 -0800)]
Move `transmute_float_to_int` test cases into separate file

`transmute.stderr` file line count exceeded due to the new test
cases so moving the new test cases into a separate file.

4 years agoAdd lint to detect transmutes from float to integer
Krishna Veera Reddy [Sun, 8 Dec 2019 00:33:49 +0000 (16:33 -0800)]
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.

4 years agoLint only exported must_use_candidates
Andre Bogus [Fri, 6 Dec 2019 19:10:14 +0000 (20:10 +0100)]
Lint only exported must_use_candidates

4 years agoAuto merge of #4884 - RobbieClarken:warn-missing-errors, r=llogiq
bors [Fri, 6 Dec 2019 11:30:43 +0000 (11:30 +0000)]
Auto merge of #4884 - RobbieClarken:warn-missing-errors, r=llogiq

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`

4 years agoAdd lint for pub fns returning a `Result` without documenting errors
RobbieClarken [Fri, 6 Dec 2019 00:00:23 +0000 (10:30 +1030)]
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 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.

4 years agoAdd widening tests for `cast_sign_loss` lint
Krishna Veera Reddy [Fri, 6 Dec 2019 01:18:27 +0000 (17:18 -0800)]
Add widening tests for `cast_sign_loss` lint

4 years agoFix false positive with cast_sign_loss lint
Krishna Veera Reddy [Thu, 5 Dec 2019 23:47:15 +0000 (15:47 -0800)]
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.

4 years agoAuto merge of #4880 - daxpedda:string-add, r=phansch
bors [Thu, 5 Dec 2019 10:33:07 +0000 (10:33 +0000)]
Auto merge of #4880 - daxpedda:string-add, r=phansch

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.

4 years agoChange to only detect in external macros.
daxpedda [Thu, 5 Dec 2019 10:06:13 +0000 (11:06 +0100)]
Change to only detect in external macros.

4 years agoFix false positive in `string_add`.
daxpedda [Wed, 4 Dec 2019 20:50:28 +0000 (21:50 +0100)]
Fix false positive in `string_add`.

4 years agoAuto merge of #4879 - matthiaskrgr:rustup_23, r=flip1995
bors [Wed, 4 Dec 2019 00:35:36 +0000 (00:35 +0000)]
Auto merge of #4879 - matthiaskrgr:rustup_23, r=flip1995

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

4 years agoRustup to rust-lang/rust#66878
Matthias Krüger [Tue, 3 Dec 2019 23:16:03 +0000 (00:16 +0100)]
Rustup to rust-lang/rust#66878

4 years agoAuto merge of #4877 - flip1995:manual_swap_4853, r=llogiq
bors [Tue, 3 Dec 2019 18:36:19 +0000 (18:36 +0000)]
Auto merge of #4877 - flip1995:manual_swap_4853, r=llogiq

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

4 years agoAuto merge of #4878 - flip1995:rustup, r=flip1995
bors [Tue, 3 Dec 2019 17:56:14 +0000 (17:56 +0000)]
Auto merge of #4878 - flip1995:rustup, r=flip1995

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

4 years agoUpdate op_ref.stderr
flip1995 [Tue, 3 Dec 2019 17:26:56 +0000 (18:26 +0100)]
Update op_ref.stderr

4 years agoMake OP_REF lint suggestion MaybeIncorrect
flip1995 [Tue, 3 Dec 2019 17:24:26 +0000 (18:24 +0100)]
Make OP_REF lint suggestion MaybeIncorrect

cc #2597

4 years agoFire clippy::op_ref on PartialOrd but !Ord types
Christopher Durham [Tue, 3 Dec 2019 01:01:50 +0000 (20:01 -0500)]
Fire clippy::op_ref on PartialOrd but !Ord types

4 years agoRustup to rust-lang/rust#66935
flip1995 [Tue, 3 Dec 2019 16:54:32 +0000 (17:54 +0100)]
Rustup to rust-lang/rust#66935

4 years agoFix rustdoc examples
flip1995 [Tue, 3 Dec 2019 15:29:05 +0000 (16:29 +0100)]
Fix rustdoc examples

4 years agoMake manual_swap autofixable
flip1995 [Tue, 3 Dec 2019 12:42:05 +0000 (13:42 +0100)]
Make manual_swap autofixable

4 years agoFormatting
flip1995 [Tue, 3 Dec 2019 12:21:00 +0000 (13:21 +0100)]
Formatting

4 years agoFix FP in manual_swap lint with slice-like types
flip1995 [Tue, 3 Dec 2019 12:20:42 +0000 (13:20 +0100)]
Fix FP in manual_swap lint with slice-like types

4 years agoAdd regression test for manual_swap
flip1995 [Tue, 3 Dec 2019 12:18:45 +0000 (13:18 +0100)]
Add regression test for manual_swap

4 years agoAuto merge of #4875 - flip1995:rustup, r=matthiaskrgr
bors [Mon, 2 Dec 2019 20:14:36 +0000 (20:14 +0000)]
Auto merge of #4875 - flip1995:rustup, r=matthiaskrgr

Rustup to rust-lang/rust#64736

cc rust-lang/rust#64736

Fixes #4872

changelog: none

4 years agoNormalize custom ICE test
flip1995 [Mon, 2 Dec 2019 19:42:39 +0000 (20:42 +0100)]
Normalize custom ICE test

Fixes #4872

4 years agoRustup to rust-lang/rust#64736
flip1995 [Mon, 2 Dec 2019 19:39:40 +0000 (20:39 +0100)]
Rustup to rust-lang/rust#64736

4 years agoAuto merge of #4873 - phansch:rustup2, r=eddyb
bors [Mon, 2 Dec 2019 15:14:18 +0000 (15:14 +0000)]
Auto merge of #4873 - phansch:rustup2, r=eddyb

Rustup to https://github.com/rust-lang/rust/pull/66789

changelog: none

4 years agoUse assert_crate_local for a more explicit error
Philipp Hansch [Mon, 2 Dec 2019 10:50:46 +0000 (11:50 +0100)]
Use assert_crate_local for a more explicit error

`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`.

4 years agoRustup to https://github.com/rust-lang/rust/pull/66789
Philipp Hansch [Mon, 2 Dec 2019 08:51:35 +0000 (09:51 +0100)]
Rustup to https://github.com/rust-lang/rust/pull/66789

4 years agoAuto merge of #4690 - lzutao:fix-test-on-non-amd64, r=flip1995
bors [Sun, 1 Dec 2019 18:39:21 +0000 (18:39 +0000)]
Auto merge of #4690 - lzutao:fix-test-on-non-amd64, r=flip1995

generate stderr file on 32bit pointer system

changelog: none

4 years agoAuto merge of #4870 - lzutao:check-macro-missing_inline_in_public_items, r=flip1995
bors [Sun, 1 Dec 2019 18:21:57 +0000 (18:21 +0000)]
Auto merge of #4870 - lzutao:check-macro-missing_inline_in_public_items, 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

4 years agoaccount for external macro in MISSING_INLINE_IN_PUBLIC_ITEMS lint
Lzu Tao [Sun, 1 Dec 2019 12:26:33 +0000 (19:26 +0700)]
account for external macro in MISSING_INLINE_IN_PUBLIC_ITEMS lint

4 years agobuild(tests/fmt): use shared target dir
Lzu Tao [Fri, 25 Oct 2019 17:05:07 +0000 (00:05 +0700)]
build(tests/fmt): use shared target dir

4 years agochore: fix and split some ui tests on 32bit system
Lzu Tao [Fri, 25 Oct 2019 15:17:13 +0000 (22:17 +0700)]
chore: fix and split some ui tests on 32bit system

4 years agobuild: set up build job for i686 targets
Lzu Tao [Fri, 25 Oct 2019 17:16:14 +0000 (00:16 +0700)]
build: set up build job for i686 targets

4 years agoremove needless my_lint ui test
Lzu Tao [Fri, 25 Oct 2019 13:09:28 +0000 (20:09 +0700)]
remove needless my_lint ui test

4 years agogit quiet
Lzu Tao [Fri, 25 Oct 2019 03:41:05 +0000 (10:41 +0700)]
git quiet

4 years agoAuto merge of #4866 - rust-lang:needful-doctest-main, r=flip1995
bors [Sun, 1 Dec 2019 00:13:17 +0000 (00:13 +0000)]
Auto merge of #4866 - rust-lang:needful-doctest-main, r=flip1995

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

4 years agoAuto merge of #4868 - lzutao:deploy-in-dir, r=phansch
bors [Sat, 30 Nov 2019 19:15:08 +0000 (19:15 +0000)]
Auto merge of #4868 - lzutao:deploy-in-dir, r=phansch

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

4 years agodeploy: cd to out/ before adding files to git
Lzu Tao [Sat, 30 Nov 2019 16:19:13 +0000 (23:19 +0700)]
deploy: cd to out/ before adding files to git

4 years agoAuto merge of #4865 - phansch:fix_master_deployment, r=llogiq
bors [Sat, 30 Nov 2019 12:46:30 +0000 (12:46 +0000)]
Auto merge of #4865 - phansch:fix_master_deployment, r=llogiq

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

4 years agoLess needless_doctest_main false positives
Andre Bogus [Fri, 29 Nov 2019 20:47:26 +0000 (21:47 +0100)]
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.

4 years agoAuto merge of #4588 - phansch:add_custom_ice_hook, r=Manishearth
bors [Fri, 29 Nov 2019 19:48:19 +0000 (19:48 +0000)]
Auto merge of #4588 - phansch:add_custom_ice_hook, r=Manishearth

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

4 years agofmt
Philipp Hansch [Fri, 15 Nov 2019 07:53:21 +0000 (08:53 +0100)]
fmt

4 years agoFeed the dog
Philipp Hansch [Wed, 9 Oct 2019 18:51:45 +0000 (20:51 +0200)]
Feed the dog

4 years agoUse rustc_env instead of exec_env for test
Philipp Hansch [Wed, 9 Oct 2019 05:45:05 +0000 (07:45 +0200)]
Use rustc_env instead of exec_env for test

4 years agoMake triggering this lint less likely :paperclip:
Philipp Hansch [Tue, 8 Oct 2019 19:35:12 +0000 (21:35 +0200)]
Make triggering this lint less likely :paperclip:

4 years agoUse exec_env to set backtrace level and normalize output
Philipp Hansch [Tue, 8 Oct 2019 19:25:10 +0000 (21:25 +0200)]
Use exec_env to set backtrace level and normalize output

4 years agoUpdate custom ICE function with latest rustc
Philipp Hansch [Tue, 8 Oct 2019 19:23:57 +0000 (21:23 +0200)]
Update custom ICE function with latest rustc

4 years agoUse Clippy version in ICE message
Philipp Hansch [Fri, 27 Sep 2019 05:25:16 +0000 (07:25 +0200)]
Use Clippy version in ICE message

4 years agoAdd custom ICE message that points to Clippy repo
Philipp Hansch [Fri, 27 Sep 2019 05:09:12 +0000 (07:09 +0200)]
Add custom ICE message that points to Clippy repo

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

4 years agoAuto merge of #4837 - flip1995:integration, r=phansch
bors [Fri, 29 Nov 2019 19:06:59 +0000 (19:06 +0000)]
Auto merge of #4837 - flip1995:integration, r=phansch

RIIR: Integration tests

In #4825 the `rust-lang/chalk` test failed because the output was too large. I didn't want to completely disabling the output, since showing the backtrace of an ICE directly in travis is pretty useful. Since finding strings in command outputs is easier in Rust, than in bash, I just RIIRed it.

This and also rewriting our tests in Rust may help with trying out new CI platforms (cc #4577)

changelog: none

4 years agoFix master deployment
Philipp Hansch [Fri, 29 Nov 2019 18:51:17 +0000 (19:51 +0100)]
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.

4 years agoAuto merge of #4856 - lzutao:rtim-non-installed, r=flip1995
bors [Fri, 29 Nov 2019 18:50:51 +0000 (18:50 +0000)]
Auto merge of #4856 - lzutao:rtim-non-installed, r=flip1995

build: check if RTIM is not installed

changelog: none

4 years agoAuto merge of #4863 - phansch:use_self, r=flip1995
bors [Fri, 29 Nov 2019 18:17:41 +0000 (18:17 +0000)]
Auto merge of #4863 - phansch:use_self, r=flip1995

Move use_self to nursery

Closes #4859

We have a lot of false positives in this lint, so I think it makes sense
to move this to the nursery until they are resolved.

changelog: Move `use_self` lint to nursery, due to many false positives

4 years agoAuto merge of #4845 - flip1995:clippy_toml_deps, r=phansch
bors [Fri, 29 Nov 2019 14:07:57 +0000 (14:07 +0000)]
Auto merge of #4845 - flip1995:clippy_toml_deps, r=phansch

Don't error on clippy.toml of dependencies

Fixes #3874

Checking for `metadata` wasn't enough anymore. `--cap-lints allow` only appears when compiling deps though.

changelog: none

4 years agoRun update_lints
flip1995 [Fri, 29 Nov 2019 13:50:19 +0000 (14:50 +0100)]
Run update_lints

4 years agoAuto merge of #4857 - rust-lang:rustup, r=matthewjasper,oli-obk
bors [Fri, 29 Nov 2019 12:56:14 +0000 (12:56 +0000)]
Auto merge of #4857 - rust-lang:rustup, r=matthewjasper,oli-obk

Rustup

From https://github.com/rust-lang/rust/pull/66246/

changelog: none

4 years agoAdd projections check to EUV for escape analysis
flip1995 [Fri, 29 Nov 2019 11:57:10 +0000 (12:57 +0100)]
Add projections check to EUV for escape analysis

4 years agoUse infer_ctxt
flip1995 [Fri, 29 Nov 2019 10:12:19 +0000 (11:12 +0100)]
Use infer_ctxt

4 years agoMove use_self to nursery
Philipp Hansch [Fri, 29 Nov 2019 06:51:49 +0000 (07:51 +0100)]
Move use_self to nursery

Closes #4859

We have a lot of false positives in this lint, so I think it makes sense
to move this to the nursery until they are resolved.

changelog: Move `use_self` lint to nursery, due to many false positives

4 years agoUse `println!` on success instead of `eprintln!`
Philipp Krones [Thu, 28 Nov 2019 16:48:29 +0000 (17:48 +0100)]
Use `println!` on success instead of `eprintln!`

Co-Authored-By: Phil Hansch <dev@phansch.net>
4 years agoRevert "Disable chalk integration test. Output too large"
flip1995 [Sat, 23 Nov 2019 15:51:37 +0000 (16:51 +0100)]
Revert "Disable chalk integration test. Output too large"

This reverts commit 553db874d7183d33040807142b1f4f79441c1d4c.

4 years agoRemove the old integration-tests.sh script
flip1995 [Sat, 23 Nov 2019 15:22:20 +0000 (16:22 +0100)]
Remove the old integration-tests.sh script

4 years agoUse rust implementation for integration tests in CI
flip1995 [Sat, 23 Nov 2019 15:21:53 +0000 (16:21 +0100)]
Use rust implementation for integration tests in CI

4 years agoRust implementation of integration test
flip1995 [Sat, 23 Nov 2019 15:21:16 +0000 (16:21 +0100)]
Rust implementation of integration test

4 years agoDon't error on clippy.toml of dependencies
flip1995 [Sat, 23 Nov 2019 01:08:36 +0000 (02:08 +0100)]
Don't error on clippy.toml of dependencies

4 years agoFix categorizations
Manish Goregaokar [Thu, 28 Nov 2019 15:33:12 +0000 (07:33 -0800)]
Fix categorizations

4 years agoFix arguments on ExprUseVisitor::new
Manish Goregaokar [Thu, 28 Nov 2019 15:20:37 +0000 (07:20 -0800)]
Fix arguments on ExprUseVisitor::new

4 years agoeuv moved from middle to typeck
Manish Goregaokar [Thu, 28 Nov 2019 15:12:05 +0000 (07:12 -0800)]
euv moved from middle to typeck

4 years agocmt_ -> Place
Manish Goregaokar [Thu, 28 Nov 2019 15:09:02 +0000 (07:09 -0800)]
cmt_ -> Place

4 years agobuild: check if RTIM is not installed
Lzu Tao [Thu, 28 Nov 2019 11:12:01 +0000 (18:12 +0700)]
build: check if RTIM is not installed

4 years agoAuto merge of #4849 - flip1995:deny_warnings, r=phansch
bors [Thu, 28 Nov 2019 10:27:46 +0000 (10:27 +0000)]
Auto merge of #4849 - flip1995:deny_warnings, r=phansch

Deny warnings in CI

Removes the `debugging` feature, that wasn't used anymore and adds/enables the `deny-warnings` feature for every sub-crate of Clippy.

changelog: none

4 years agoAuto merge of #4855 - phansch:rollup-x7yail7, r=phansch
bors [Thu, 28 Nov 2019 09:30:16 +0000 (09:30 +0000)]
Auto merge of #4855 - phansch:rollup-x7yail7, r=phansch

Rollup of 3 pull requests

Successful merges:

 - #4832 (Add some positive examples to lint docs)
 - #4842 ([comparison_chain] #4827 Check `core::cmp::Ord` is implemented)
 - #4847 (fixing a typo)

Failed merges:

changelog: none

r? @ghost

4 years agoRollup merge of #4847 - rust-lang:offest, r=phansch
Phil Hansch [Thu, 28 Nov 2019 09:19:06 +0000 (10:19 +0100)]
Rollup merge of #4847 - rust-lang:offest, r=phansch

fixing a typo

changelog: none

4 years agoRollup merge of #4842 - timbodeit:comparison-chain-false-positive-4827, r=flip1995
Phil Hansch [Thu, 28 Nov 2019 09:19:05 +0000 (10:19 +0100)]
Rollup merge of #4842 - timbodeit:comparison-chain-false-positive-4827, r=flip1995

[comparison_chain] #4827 Check `core::cmp::Ord` is implemented

Only emit `comparison_chain` lint, if `cmp` is actually available on the type being compared. Don't emit lint in cases where only `PartialOrd` is implemented.

I haven't yet fully understood [Adjustments](https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/adjustment/struct.Adjustment.html). I would appreciate, if someone could double check whether my usage of [expr_ty](https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/struct.TypeckTables.html#method.expr_ty) in `clippy_lints/src/comparison_chain.rs:91` is correct or if there are cases where using [expr_ty_adjusted](https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/struct.TypeckTables.html#method.expr_ty_adjusted) would lead to a different result when used with `utils::implements_trait`.

---

fixes #4827
changelog: [comparison_chain] Check `core::cmp::Ord` is implemented

4 years agoRollup merge of #4832 - dario23:i4829, r=phansch
Phil Hansch [Thu, 28 Nov 2019 09:19:04 +0000 (10:19 +0100)]
Rollup merge of #4832 - dario23:i4829, r=phansch

Add some positive examples to lint docs

fixes #4829
changelog: Add some positive examples to lint docs

4 years agoAuto merge of #4851 - daxpedda:float-arithmetic, r=flip1995
bors [Thu, 28 Nov 2019 09:11:45 +0000 (09:11 +0000)]
Auto merge of #4851 - daxpedda:float-arithmetic, r=flip1995

Remove negative float literal checks.

Fixes #4850.

changelog: Remove negative float literal checks.

4 years agoAuto merge of #4821 - Areredify:as_conversions, r=flip1995
bors [Thu, 28 Nov 2019 08:53:36 +0000 (08:53 +0000)]
Auto merge of #4821 - Areredify:as_conversions, r=flip1995

Add `as_conversions` lint

changelog: closes #4771, adding a new pedantic allow-by-default lint that lints against any usage of `as`.

4 years agoAuto merge of #4808 - euclio:string-lit-as-bytes, r=phansch
bors [Thu, 28 Nov 2019 07:26:04 +0000 (07:26 +0000)]
Auto merge of #4808 - euclio:string-lit-as-bytes, r=phansch

trigger string_lit_as_bytes when literal has escapes

---

changelog: fix string_lit_as_bytes false negative

Depends on rust-lang/rust#66349.

Fixes #4796.

4 years agoAuto merge of #4848 - lzutao:result-map_or, r=flip1995
bors [Thu, 28 Nov 2019 07:07:16 +0000 (07:07 +0000)]
Auto merge of #4848 - lzutao:result-map_or, r=flip1995

make use of Result::map_or

Fixes #1590

changelog: none

4 years agomake use of Result::map_or
Lzu Tao [Tue, 26 Nov 2019 14:14:28 +0000 (14:14 +0000)]
make use of Result::map_or

4 years agoAuto merge of #4846 - flip1995:rustup, r=Manishearth
bors [Wed, 27 Nov 2019 23:10:00 +0000 (23:10 +0000)]
Auto merge of #4846 - flip1995:rustup, r=Manishearth

Rustup to rustc 1.41.0-nightly (e87a205c2 2019-11-27)

Rustups:

- rust-lang/rust#66671 (Ast address-of)
- rust-lang/rust#64856 (Scope format! temporaries)
 - http://github.com/rust-lang/rust/pull/66719

changelog: none

4 years agoconfig.usize_ty -> config.ptr_width
Manish Goregaokar [Wed, 27 Nov 2019 22:41:22 +0000 (14:41 -0800)]
config.usize_ty -> config.ptr_width

From http://github.com/rust-lang/rust/pull/66719

4 years agoAdd blank stderr file for cant_be_const test
Manish Goregaokar [Wed, 27 Nov 2019 22:47:20 +0000 (14:47 -0800)]
Add blank stderr file for cant_be_const test

4 years agoMore borrowkind fixes
Manish Goregaokar [Wed, 27 Nov 2019 22:43:22 +0000 (14:43 -0800)]
More borrowkind fixes

4 years agoRe-add wildcards for BorrowKind in some places
Manish Goregaokar [Wed, 27 Nov 2019 22:34:32 +0000 (14:34 -0800)]
Re-add wildcards for BorrowKind in some places

4 years agoMerge pull request #4852 from lzutao/cargo_install
Manish Goregaokar [Wed, 27 Nov 2019 22:51:13 +0000 (14:51 -0800)]
Merge pull request #4852 from lzutao/cargo_install

rustup cargo install-upgrade

4 years agoAdd BorrowKind::Ref
Manish Goregaokar [Wed, 27 Nov 2019 22:30:10 +0000 (14:30 -0800)]
Add BorrowKind::Ref

4 years agorustup cargo install-upgrade
Lzu Tao [Wed, 27 Nov 2019 09:32:51 +0000 (16:32 +0700)]
rustup cargo install-upgrade

4 years agotrigger string_lit_as_bytes when literal has escapes
Andy Russell [Mon, 11 Nov 2019 22:42:12 +0000 (17:42 -0500)]
trigger string_lit_as_bytes when literal has escapes

4 years agoRemove negative float literal checks.
daxpedda [Mon, 25 Nov 2019 18:23:28 +0000 (19:23 +0100)]
Remove negative float literal checks.