Marcel Hellwig [Wed, 16 Oct 2019 11:25:42 +0000 (13:25 +0200)]
Add lint for debug_assert_with_mut_call
This lint will complain when you put a mutable function/method call
inside a `debug_assert` macro, because it will not be executed in
release mode, therefore it will change the execution flow, which is not
wanted.
Lzu Tao [Thu, 17 Oct 2019 10:02:24 +0000 (17:02 +0700)]
macos: symlink rustc dev libs to /usr/local/lib
Due to System Integrity Protection (SIP), exporting
LD_LIBRARY_PATH will not work on macOS systems.
Therefore, rather than disable SIP, we could symlink
those rust dev libs to /usr/local/bin.
I already tried install_name_tool(1) but couldn't make
clippy-driver work on CI for whatever reasons.
bors [Sat, 19 Oct 2019 09:14:29 +0000 (09:14 +0000)]
Auto merge of #4692 - lzutao:use-opt-profile-rtim, r=phansch
build: use release build of RTIM
rustup-toolchain-install-master on Travis Windows builds is
unexpectedly slower compared to when run on other OSes.
This commit tries to use release build of RTIM as a mean to
improve performance there.
Lzu Tao [Fri, 18 Oct 2019 07:58:26 +0000 (14:58 +0700)]
build: use release build of RTIM
rustup-toolchain-install-master on Travis Windows builds is
unexpectedly slower when it was running on other OSes.
This commit tries to use release build of RTIM as a mean to
improve performance there.
bors [Fri, 18 Oct 2019 04:53:16 +0000 (04:53 +0000)]
Auto merge of #4687 - lzutao:before-cache-appveyor, r=Manishearth
appveyor: on_finish run after saving cache
According to <https://www.appveyor.com/docs/build-configuration/#build-pipeline>
on_finish step runs after saving cache step, we should use after_test instead.
bors [Tue, 15 Oct 2019 17:57:10 +0000 (17:57 +0000)]
Auto merge of #4671 - flip1995:ice-4671, r=phansch
Fix ICE in `use_self` lint
The ICE is produced by building this span:
https://github.com/rust-lang/rust-clippy/blob/55e7818a06c8d83bead9c81e10e73ba33fb20890/clippy_lints/src/use_self.rs#L55-L60
`span` can start in the file the macro is defined in and end where the macro is called.
The first one checks if an public function or method has no mutable argument and mutates no non-local data and lints if it has no `#[must_use]` attribute. It will skip inner functions, because those are usually highly local and the attribute doesn't have as much benefit there.
The second lints `#[must_use]` attributes on functions and methods that return unit. Those attributes are likely a remnant from a refactoring that removed the return value.
The last one lints for `#[must_use]` attributrs without text on functions that return a type which is already marked `#[must_use]`. This has no auto-suggestion, because while it would be easy to do, there may be value in writing a detailed text for the attribute instead.
Andre Bogus [Wed, 18 Sep 2019 06:37:41 +0000 (08:37 +0200)]
new lints around `#[must_use]` fns
`must_use_unit` lints unit-returning functions with a `#[must_use]`
attribute, suggesting to remove it.
`double_must_use` lints functions with a plain `#[must_use]`
attribute, but which return a type which is already `#[must_use]`,
so the attribute has no benefit.
`must_use_candidate` is a pedantic lint that lints functions and
methods that return some non-unit type that is not already
`#[must_use]` and suggests to add the annotation.
bors [Wed, 9 Oct 2019 08:56:30 +0000 (08:56 +0000)]
Auto merge of #4635 - Lythenas:suggestions-for-assert-false, r=flip1995
Add assert message to suggestion in lint assertions_on_constants
<!--
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.
bors [Tue, 8 Oct 2019 16:17:48 +0000 (16:17 +0000)]
Auto merge of #4602 - EthanTheMaster:issue-4001, r=flip1995
Add suggestion for mul_add
Issue #4001: Whenever `a*b+c` is found where `a`,`b`, and `c` are floats, a lint is suggested saying to use `a.mul_add(b, c)`. Using `mul_add` may give a performance boost depending on the target architecture and also has higher numerical accuracy as there is no round off when doing `a*b`.
bors [Tue, 8 Oct 2019 07:11:26 +0000 (07:11 +0000)]
Auto merge of #4611 - rust-lang:doc-visibility, r=flip1995
account for doc visibility
This fixes #4608.
Also I noticed that the lint failed to look at trait and impl items. There's a small bit of fallout in the code, too, but not enough to warrant its own commit.
changelog: check docs of trait items and impl items, also make `missing_safety_doc` account for visibility
bors [Tue, 8 Oct 2019 05:09:53 +0000 (05:09 +0000)]
Auto merge of #4628 - flip1995:rustup, r=phansch
Rustup to rust-lang/rust#64874
TODO:
- [x] replace `rvalue_promotable_map` in [1]
- [ ] ~~fix [2] according to this comment https://github.com/rust-lang/rust/pull/64874#issuecomment-536203626 this should be merged with `consume`, but I didn't figure out how to merge them, yet.~~
- [ ] ~~fix [3]; What to do with `LoanCause`?~~
[2]+[3] probably have to be resolved by a rewrite of the lint. https://github.com/rust-lang/rust-clippy/pull/4628#issuecomment-538574944