]>
git.lizzy.rs Git - rust.git/log
flip1995 [Thu, 27 Feb 2020 16:56:39 +0000 (17:56 +0100)]
Fix deploy script for tag deploys
bors [Thu, 27 Feb 2020 09:52:56 +0000 (09:52 +0000)]
Auto merge of #5232 - JohnTitor:git2-0.12, r=phansch
Update git2 to 0.12
changelog: none
Yuki Okushi [Thu, 27 Feb 2020 04:40:48 +0000 (13:40 +0900)]
Update git2 to 0.12
bors [Thu, 27 Feb 2020 06:40:31 +0000 (06:40 +0000)]
Auto merge of #5231 - JohnTitor:associated-type-defaults, r=phansch
Rustup to rust-lang/rust#61812
changelog: none
Yuki Okushi [Thu, 27 Feb 2020 03:19:18 +0000 (12:19 +0900)]
Rustup to rust-lang/rust#61812
bors [Mon, 24 Feb 2020 08:33:03 +0000 (08:33 +0000)]
Auto merge of #4897 - krishna-veerareddy:issue-2040-accurate-float-functions, r=flip1995
Add lint to improve floating-point expressions
Looks for floating-point expressions that can be expressed using built-in methods to improve accuracy, performance and/or succinctness.
changelog: Add lint `floating_point_improvements`.
Fixes #4726
Partly addresses [#2040](https://github.com/rust-lang/rust-clippy/issues/2040)
Currently linted expressions:
| Expression | Suggestion |
|---------------------------------|------------|
| x.log(2.0) | x.log2() |
| x.log(10.0) | x.log10() |
| x.log(std::f32::consts::E) | x.ln() |
| (1 + x).ln() | x.ln_1p() |
| (2.0).powf(x) | x.exp2() |
| (std::f32::consts::E).powf(x) | x.exp() |
| x.powf(1/2) | x.sqrt() |
| x.powf(1/3) | x.cbrt() |
| x.powf(y), where y is whole | x.powi(y) |
| x.exp() - 1 | x.exp_m1() |
|x * y + z|x.mul_add(y, z)|
bors [Mon, 24 Feb 2020 08:20:10 +0000 (08:20 +0000)]
Auto merge of #5222 - JohnTitor:dont-deploy, r=flip1995
Do not run deploy action on other repos
Usually, we don't have to run deploy action on other repos, let's ignore there.
changelog: none
Krishna Sai Veera Reddy [Mon, 24 Feb 2020 05:06:55 +0000 (21:06 -0800)]
Add `imprecise_flops` lint
Add lint to detect floating point operations that can be computed more
accurately at the cost of performance. `cbrt`, `ln_1p` and `exp_m1`
library functions call their equivalent cmath implementations which is
slower but more accurate so moving checks for these under this new lint.
Krishna Sai Veera Reddy [Mon, 24 Feb 2020 04:48:57 +0000 (20:48 -0800)]
Rename `mul_add` test file and add general improvements
Krishna Sai Veera Reddy [Sun, 23 Feb 2020 08:04:11 +0000 (00:04 -0800)]
Move `manual_mul_add` into `suboptimal_flops` lint
Krishna Sai Veera Reddy [Sun, 23 Feb 2020 04:32:13 +0000 (20:32 -0800)]
Run rust-fix on tests
Krishna Sai Veera Reddy [Sun, 23 Feb 2020 04:29:22 +0000 (20:29 -0800)]
Fix `powi` suggestion and add general improvements
Krishna Sai Veera Reddy [Mon, 17 Feb 2020 20:56:55 +0000 (12:56 -0800)]
Change lint name to `suboptimal_flops`
Krishna Sai Veera Reddy [Mon, 17 Feb 2020 19:38:35 +0000 (11:38 -0800)]
Remove lint for logarithm division identity
Krishna Veera Reddy [Sat, 4 Jan 2020 06:19:13 +0000 (22:19 -0800)]
Add type suffixes to unsuffixed method receiver suggestions
Krishna Veera Reddy [Sat, 21 Dec 2019 04:07:03 +0000 (20:07 -0800)]
Detect usage of `(x + 1).ln()` and suggest `x.ln_1p()` instead
Krishna Veera Reddy [Sat, 21 Dec 2019 01:57:47 +0000 (17:57 -0800)]
Split test cases into separate files
Krishna Veera Reddy [Tue, 17 Dec 2019 02:03:51 +0000 (18:03 -0800)]
Lint expressions of the form `x.log(b) / y.log(b)`
Krishna Veera Reddy [Mon, 16 Dec 2019 03:26:44 +0000 (19:26 -0800)]
Suggest usage of `powi` method when applicable
Krishna Veera Reddy [Sun, 15 Dec 2019 04:10:23 +0000 (20:10 -0800)]
Consolidate the accuracy and efficiency lints
Merge the accuracy and efficiency lints into a single lint that
checks for improvements to accuracy, efficiency and readability
of floating-point expressions.
Krishna Veera Reddy [Sat, 14 Dec 2019 17:28:11 +0000 (09:28 -0800)]
Add lints to detect inaccurate and inefficient FP operations
Add lints to detect floating point computations that are either
inaccurate or inefficient and suggest better alternatives.
Yuki Okushi [Mon, 24 Feb 2020 04:38:35 +0000 (13:38 +0900)]
Do not run deploy action on other repos
bors [Mon, 24 Feb 2020 05:58:17 +0000 (05:58 +0000)]
Auto merge of #5221 - JohnTitor:rustup, r=phansch
Rustup to rust-lang/rust#69366
changelog: none
Yuki Okushi [Mon, 24 Feb 2020 04:33:04 +0000 (13:33 +0900)]
Rustup to rust-lang/rust#69366
bors [Sat, 22 Feb 2020 12:44:06 +0000 (12:44 +0000)]
Auto merge of #5216 - krishna-veerareddy:issue-5192-fp-const-fn, r=flip1995
Prevent `missing_const_for_fn` on functions with const generic params
`const` functions cannot have const generic parameters so prevent the
`missing_const_for_fn` lint from firing in that case.
changelog: Fix false positive in `missing_const_for_fn`
Fixes #5192
Krishna Sai Veera Reddy [Sat, 22 Feb 2020 03:52:04 +0000 (19:52 -0800)]
Prevent `missing_const_for_fn` on functions with const generic params
`const` functions cannot have const generic parameters so prevent the
`missing_const_for_fn` lint from firing in that case.
bors [Fri, 21 Feb 2020 11:32:12 +0000 (11:32 +0000)]
Auto merge of #5029 - flip1995:wildcard_imports, r=phansch
New Lint: `wildcard imports`
Fixes #1228
### A few notes:
- I put this lint in the pedantic group, even though in the issue restriction was mentioned.
- Every fallout fix was automatically applied by `cargo fix` (This produced 3 `unused_imports` warnings) and are in commit
7e834c8 . So reverting these changes wouldn't be a problem.
### A few ideas:
- A configuration to specify the amount of imported Items, where a `*` might be better.
- ~~A configuration to disable the lint for enums. Or just disable the lint for enums, since there is [`enum_glob_use`](https://rust-lang.github.io/rust-clippy/master/index.html#enum_glob_use)~~ I moved `enum_glob_use` into this lint in
12937f0
### A few quotes from the issue:
> Is there a way to ask the compiler about the modules or symbols that the current file is using?
Yes there is. I found it, once I was nearly finished implementing it myself. See
321d64a
> one hard optional feature would be to figure out what is currently used and add a suggestion to replace it with a full import list.
Yeah that was pretty hard, until I found the query for this. Queries are cool, but too hard to find.
> FWIW VS Code and Intellij IDEA both offer imports deglobbing which replace * with required imports.
And now, Clippy can do this too! :tada:
---
Your thoughts on the notes/ideas?
changelog: Add new lint [`wildcard imports`]. Add suggestion to [`enum_glob_use`]
flip1995 [Fri, 21 Feb 2020 09:15:38 +0000 (10:15 +0100)]
Fix suggestion for weird formattings
flip1995 [Fri, 21 Feb 2020 08:40:13 +0000 (09:40 +0100)]
Don't use use ty::TyKind::*
flip1995 [Fri, 21 Feb 2020 08:39:38 +0000 (09:39 +0100)]
Fix fallout
flip1995 [Sun, 9 Feb 2020 11:55:20 +0000 (12:55 +0100)]
Add test for prelude import
flip1995 [Sun, 9 Feb 2020 11:23:13 +0000 (12:23 +0100)]
Filter prelude glob imports
flip1995 [Tue, 14 Jan 2020 12:52:08 +0000 (13:52 +0100)]
Move enum_glob_use lint into wildcard_imports pass
flip1995 [Thu, 9 Jan 2020 17:12:54 +0000 (18:12 +0100)]
Let's do it the easy way
Queries are cool, but too hard to find.
flip1995 [Tue, 7 Jan 2020 16:54:08 +0000 (17:54 +0100)]
Run update_lints
flip1995 [Tue, 7 Jan 2020 16:53:56 +0000 (17:53 +0100)]
Implement wildcard_imports lint
flip1995 [Tue, 7 Jan 2020 16:53:33 +0000 (17:53 +0100)]
Add tests for wildcard_imports lint
bors [Fri, 21 Feb 2020 09:43:55 +0000 (09:43 +0000)]
Auto merge of #5202 - krishna-veerareddy:issue-5201-move-lossy-float-literal-restriction, r=flip1995
Move check for lossy whole-number floats out of `excessive_precision`
changelog: Add new lint `lossy_float_literal` to detect lossy whole number float literals and move it out of `excessive_precision` again.
Fixes #5201
bors [Fri, 21 Feb 2020 08:27:37 +0000 (08:27 +0000)]
Auto merge of #5213 - JohnTitor:warm-return-ty, r=flip1995
Use generator own DefId
Fixes #5207
changelog: Fix ICE in `missing_errors_doc`
bors [Fri, 21 Feb 2020 08:14:30 +0000 (08:14 +0000)]
Auto merge of #5200 - nipunn1313:unneeded_field_pattern, r=flip1995
Move unneeded_field_pattern to restriction group
Fixes #1741
changelog: Move unneeded_field_pattern to pedantic group
Yuki Okushi [Fri, 21 Feb 2020 07:24:58 +0000 (16:24 +0900)]
Use generator own DefId
Krishna Sai Veera Reddy [Fri, 21 Feb 2020 02:32:06 +0000 (18:32 -0800)]
Separate out lint to check lossy whole number float literals
bors [Fri, 21 Feb 2020 06:19:02 +0000 (06:19 +0000)]
Auto merge of #5211 - krishna-veerareddy:rustup-69072, r=flip1995
Rustup to rust-lang/rust#69072
changelog: none
Krishna Sai Veera Reddy [Fri, 21 Feb 2020 05:20:49 +0000 (21:20 -0800)]
Rustup to rust-lang/rust#69072
bors [Thu, 20 Feb 2020 22:57:02 +0000 (22:57 +0000)]
Auto merge of #5208 - matthiaskrgr:stderr, r=flip1995
rustup https://github.com/rust-lang/rust/pull/69325, update test stderr
changelog: none
Matthias Krüger [Thu, 20 Feb 2020 22:54:10 +0000 (23:54 +0100)]
rustup https://github.com/rust-lang/rust/pull/69325, update test stderr
Nipunn Koorapati [Wed, 19 Feb 2020 23:32:59 +0000 (15:32 -0800)]
Move unneeded_field_pattern to restriction group
Fixes https://github.com/rust-lang/rust-clippy/issues/1741
bors [Thu, 20 Feb 2020 16:23:53 +0000 (16:23 +0000)]
Auto merge of #5204 - flip1995:license, r=Manishearth
Update License
r? @Manishearth
I'm not sure if the Copyright claim was left out on purpose in the LICENSE-* files. I added them, because the official templates have them.
changelog: none
bors [Thu, 20 Feb 2020 12:16:48 +0000 (12:16 +0000)]
Auto merge of #5198 - sinkuu:redundant_clone_df, r=flip1995
redundant_clone: Migrate to new dataflow framework
Migration to [the new dataflow framework](https://github.com/rust-lang/rust/pull/65672) is ongoing in rustc. This PR updates the dataflow impl in `redundant_clone` lint.
---
changelog: none
flip1995 [Thu, 20 Feb 2020 11:06:06 +0000 (12:06 +0100)]
Remove remaining license header in test file
flip1995 [Thu, 20 Feb 2020 11:05:34 +0000 (12:05 +0100)]
Update Copyright year
flip1995 [Thu, 20 Feb 2020 11:05:12 +0000 (12:05 +0100)]
Add Copyright claim, where missing
Shotaro Yamada [Fri, 14 Feb 2020 05:42:10 +0000 (14:42 +0900)]
Migrate to generic dataflow
Shotaro Yamada [Fri, 14 Feb 2020 05:07:06 +0000 (14:07 +0900)]
Rename for clarity
bors [Wed, 19 Feb 2020 10:51:25 +0000 (10:51 +0000)]
Auto merge of #5190 - flip1995:nuke_traveyor, r=phansch,Manishearth,llogiq,flip1995
I like to move it, move it
GHA now runs in the background for 6 days (#5088)
Since then ~~15~~ 19 PRs were successfully merged and Travis+Appveyor agreed on the status in every case. ([GitHub PR search query](https://github.com/rust-lang/rust-clippy/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Amerged+merged%3A%3E%3D2020-02-12T15%3A42%3A00+sort%3Aupdated-desc+NOT+%5Bgh-pages%5D+in%3Atitle))
Some PRs were:
- #5163
- #5170
- #5168
- #5173
- #5171
- #5156
- #4809
- #5177
- #5182
- #5183
- #5184
- #5185
- #5186
- #5181
- #5189
Bug with GHA:
- When a rustc PR gets merged between the `integration_build` and the `integration` job, the `integration` job will fail. This happened once in #5162, but not in the past 6 days. Even if it would happen every 4th PR we would save time, since splitting up the integration build and tests saves 5-7 minutes per run and a complete run takes 15-17 minutes
- Sometimes the MacOS build takes up to an hour to download the master toolchain. Until now, this happend 2 or 3 times and can be resolved by a `@bors r3try`+canceling the previous run (restarting single jobs is not supported yet)
## Before merging this, https://github.com/rust-lang/rust-central-station/pull/578 has to get merged
This PR is for starting the discussion and to get consensus (@rust-lang/clippy) on a final move to GHA. If we're ready, I'll contact Pietro, to finalize the move.
changelog: Clippy completely runs on GHA now :tada:
---
BTW: The deployment already runs on GHA, instead of Travis.
bors [Wed, 19 Feb 2020 01:50:53 +0000 (01:50 +0000)]
Auto merge of #5195 - JohnTitor:rustup-take2, r=matthiaskrgr
Rustup to rust-lang/rust#69194
changelog: none
Yuki Okushi [Wed, 19 Feb 2020 01:43:49 +0000 (10:43 +0900)]
Rustup to rust-lang/rust#69194
bors [Tue, 18 Feb 2020 23:47:39 +0000 (23:47 +0000)]
Auto merge of #5194 - JohnTitor:rustup-0219, r=matthiaskrgr
Rustup to rust-lang/rust#69181
changelog: none
Yuki Okushi [Tue, 18 Feb 2020 22:33:19 +0000 (07:33 +0900)]
Rustup to rust-lang/rust#69181
bors [Tue, 18 Feb 2020 16:27:41 +0000 (16:27 +0000)]
Auto merge of #5193 - krishna-veerareddy:add-more-log-consts, r=flip1995
Add `LOG2_10` and `LOG10_2` to `approx_const` lint
changelog: Add constants `LOG2_10` and `LOG10_2` to `approx_const` lint
Krishna Sai Veera Reddy [Tue, 18 Feb 2020 16:04:02 +0000 (08:04 -0800)]
Add `LOG2_10` and `LOG10_2` to `approx_const` lint
bors [Tue, 18 Feb 2020 15:06:49 +0000 (15:06 +0000)]
Auto merge of #5191 - JohnTitor:clean-up, r=flip1995
Minor cleanup
- Use `Vec::with_capacity()` as possible
- Clean up imports
changelog: none
Yuki Okushi [Tue, 18 Feb 2020 13:28:18 +0000 (22:28 +0900)]
Clean up imports
Yuki Okushi [Tue, 18 Feb 2020 11:50:10 +0000 (20:50 +0900)]
Use `Vec::with_capacity()` as possible
flip1995 [Wed, 12 Feb 2020 16:16:39 +0000 (17:16 +0100)]
Nuke Travis+AppVeyor CI
bors [Mon, 17 Feb 2020 20:49:21 +0000 (20:49 +0000)]
Auto merge of #5189 - jonhoo:async-fn-main-not-needless, r=llogiq
needless_doctest_main: False positive for async fn
Fixes #5188.
---
changelog: none
Jon Gjengset [Mon, 17 Feb 2020 18:47:42 +0000 (13:47 -0500)]
needless_doctest_main: False positive for async fn
Fixes #5188.
bors [Mon, 17 Feb 2020 13:57:01 +0000 (13:57 +0000)]
Auto merge of #5181 - daxpedda:future-missing-errors-doc, r=flip1995
Expand `missing_errors_doc` to also work on async functions
This adds the `missing_errors_doc` lint to async functions.
changelog: Make [`missing_errors_doc`] lint also trigger on `async` functions
daxpedda [Mon, 17 Feb 2020 13:19:09 +0000 (14:19 +0100)]
Remove use of `TyKind`.
daxpedda [Mon, 17 Feb 2020 11:18:00 +0000 (12:18 +0100)]
Use `if_chain`.
daxpedda [Mon, 17 Feb 2020 01:38:48 +0000 (02:38 +0100)]
Fix ICE.
daxpedda [Mon, 17 Feb 2020 00:17:14 +0000 (01:17 +0100)]
Add tests and improve checks.
daxpedda [Sun, 16 Feb 2020 21:49:47 +0000 (22:49 +0100)]
Add `Future` detection for `missing_errors_doc`.
bors [Mon, 17 Feb 2020 13:01:21 +0000 (13:01 +0000)]
Auto merge of #5186 - JohnTitor:rename-fnretty, r=flip1995
Rename `FunctionRetTy` to `FnRetTy`
Rustup to rust-lang/rust#69179
changelog: none
Yuki Okushi [Mon, 17 Feb 2020 09:36:17 +0000 (18:36 +0900)]
Rename `FunctionRetTy` to `FnRetTy`
bors [Mon, 17 Feb 2020 09:18:25 +0000 (09:18 +0000)]
Auto merge of #5185 - krishna-veerareddy:issue-5160-lossy-float-literal, r=flip1995
Lint lossy whole number float literals
changelog: Extend `excessive_precision` to lint lossy whole number float literals
Fixes #5160
Krishna Sai Veera Reddy [Mon, 17 Feb 2020 08:17:26 +0000 (00:17 -0800)]
Uplift `excessive_precision` to the correctness category
Krishna Sai Veera Reddy [Mon, 17 Feb 2020 07:55:16 +0000 (23:55 -0800)]
Add tests for lossy whole number float literals
Krishna Sai Veera Reddy [Mon, 17 Feb 2020 07:48:10 +0000 (23:48 -0800)]
Add lint to detect lossy float literals
bors [Mon, 17 Feb 2020 05:54:44 +0000 (05:54 +0000)]
Auto merge of #5184 - JohnTitor:reduce-dep-size, r=phansch
Reduce `pulldown-cmark` size
Should reduce `pulldown-cmark` size.
ref. https://github.com/raphlinus/pulldown-cmark#build-options
changelog: none
Yuki Okushi [Mon, 17 Feb 2020 04:39:48 +0000 (13:39 +0900)]
Reduce pulldown-cmark size
bors [Mon, 17 Feb 2020 03:33:01 +0000 (03:33 +0000)]
Auto merge of #5183 - JohnTitor:fix-fp-import, r=matthiaskrgr
Don't lint `single_component_path_imports` in macros
Fixes #5154
changelog: Fix false positive in `single_component_path_imports`
bors [Mon, 17 Feb 2020 03:04:00 +0000 (03:04 +0000)]
Auto merge of #5182 - JohnTitor:infer, r=matthiaskrgr
Rustup to rust-lang/rust#67953
changelog: none
Yuki Okushi [Sun, 16 Feb 2020 20:44:38 +0000 (05:44 +0900)]
Don't lint `single_component_path_imports` in macros
Yuki Okushi [Mon, 17 Feb 2020 02:07:26 +0000 (11:07 +0900)]
Rustup to rust-lang/rust#67953
bors [Sat, 15 Feb 2020 16:47:06 +0000 (16:47 +0000)]
Auto merge of #5177 - matthewjasper:own-infer, r=flip1995
Avoid using regions from `TypeckTables`
These regions will all be `ReErased` soon. (rust-lang/rust#69189)
changelog: none
Matthew Jasper [Sat, 15 Feb 2020 16:24:49 +0000 (16:24 +0000)]
Avoid using regions from `TypeckTables`
These regions will all be `ReErased` soon.
bors [Sat, 15 Feb 2020 15:12:14 +0000 (15:12 +0000)]
Auto merge of #4809 - iankronquist:patch-1, r=flip1995
Typo in literal_representation.rs
Octal numbers can't have 8 in them ;)
changelog: none
bors [Sat, 15 Feb 2020 10:25:54 +0000 (10:25 +0000)]
Auto merge of #5156 - flip1995:dev_add_internal, r=phansch
Let update_lints also generate the internal lints
r? @phansch
changelog: none
flip1995 [Fri, 14 Feb 2020 13:42:24 +0000 (14:42 +0100)]
Adapt gen_lint_group_list test to also generate internal lints
flip1995 [Wed, 12 Feb 2020 08:12:19 +0000 (09:12 +0100)]
Rename lint_count -> usable_lint_count
flip1995 [Tue, 11 Feb 2020 10:29:03 +0000 (11:29 +0100)]
Update some documentation
flip1995 [Tue, 11 Feb 2020 10:11:43 +0000 (11:11 +0100)]
Let update_lints also generate the internal lints
flip1995 [Tue, 11 Feb 2020 10:10:54 +0000 (11:10 +0100)]
Save Lint::module as full path of module
flip1995 [Tue, 11 Feb 2020 10:07:38 +0000 (11:07 +0100)]
Make Lint::by_lint_group take impl Iterator as argument
bors [Fri, 14 Feb 2020 13:05:29 +0000 (13:05 +0000)]
Auto merge of #5171 - flip1995:deploy, r=Manishearth
Improve deployment and documentation
**This should be merged shortly after** #5172
This extracts the python code that generated the `versions.json` file and now sorts the versions. in addition to that it improves the order on the website, respecting the new `rust-*` directories.
The new appearance of the documentation site can be previewed here: https://flip1995.github.io/rust-clippy/
changelog: Add documentation for Clippy stable releases at https://rust-lang.github.io/rust-clippy/
flip1995 [Fri, 14 Feb 2020 11:03:48 +0000 (12:03 +0100)]
Rename current -> stable
bors [Thu, 13 Feb 2020 22:09:38 +0000 (22:09 +0000)]
Auto merge of #5173 - matthiaskrgr:pulldown, r=flip1995
deps: update pulldown-cmark from 0.6 to 0.7
changelog: none
Matthias Krüger [Thu, 13 Feb 2020 21:01:26 +0000 (22:01 +0100)]
deps: update pulldown-cmark from 0.6 to 0.7
flip1995 [Thu, 13 Feb 2020 17:07:56 +0000 (18:07 +0100)]
Use python3 instead of python
This changes the formatting a bit of json.dump(..)