]>
git.lizzy.rs Git - rust.git/log
bors [Tue, 25 Aug 2020 16:54:48 +0000 (16:54 +0000)]
Auto merge of #5952 - 1c3t3a:1c3t3a-dev-5819, r=Manishearth
Added a lint which corrects expressions like (a - b) < f32::EPSILON, according to #5819
Fixes #5819
changelog: none
bors [Tue, 25 Aug 2020 16:33:17 +0000 (16:33 +0000)]
Auto merge of #5947 - ebroto:rustup_doc_improvements, r=flip1995
Improve documentation related to the sync process
[Rendered](https://github.com/ebroto/rust-clippy/blob/rustup_doc_improvements/CONTRIBUTING.md)
r? @flip1995
changelog: none
bors [Tue, 25 Aug 2020 16:11:17 +0000 (16:11 +0000)]
Auto merge of #5960 - flip1995:rustup, r=flip1995
Rustup
r? @ghost
changelog: none
Bastian [Tue, 25 Aug 2020 11:41:39 +0000 (13:41 +0200)]
Added F32::EPSILON and F64::EPSILON to paths.rs
bors [Tue, 25 Aug 2020 03:29:59 +0000 (03:29 +0000)]
Auto merge of #5920 - giraffate:fix_fp_for_redundant_closure_call, r=mikerite
Fix FP for `redundant_closure_call`
Fix #5916
changelog: Fix FP for `redundant_closure_call` when called in function body
Scott McMurray [Mon, 24 Aug 2020 21:28:01 +0000 (14:28 -0700)]
Unbreak the clippy test
bors [Mon, 24 Aug 2020 18:08:39 +0000 (18:08 +0000)]
Auto merge of #5935 - matthiaskrgr:unstable_sort_ty_name, r=flip1995
stable_sort_primitive: print the type that is being sorted in the lint message
changelog: stable_sort_primitive: print the type that is being sorted in the lint message
Matthias Krüger [Fri, 21 Aug 2020 00:03:57 +0000 (02:03 +0200)]
stable_sort_primitive: print the type that is being sorted in the lint message
Bastian [Mon, 24 Aug 2020 14:31:51 +0000 (16:31 +0200)]
Added a lint which corrects expressions like (a - b) < f32::EPSILON
Takayuki Nakata [Mon, 24 Aug 2020 01:11:53 +0000 (10:11 +0900)]
Avoid period in lint message according to convention
Takayuki Nakata [Tue, 18 Aug 2020 14:00:21 +0000 (23:00 +0900)]
Fix FP for `redundant_closure_call`
Visit the nested things like function body when checking closure call.
Eduardo Broto [Sun, 23 Aug 2020 20:20:55 +0000 (22:20 +0200)]
Apply suggestions from PR review
bors [Sun, 23 Aug 2020 14:13:58 +0000 (14:13 +0000)]
Auto merge of #5948 - ebroto:5944_repeat_ice, r=Manishearth
Fix ICE in `repeat_once`
changelog: Fix ICE in [`repeat_once`]
Fixes #5944
bors [Sun, 23 Aug 2020 10:59:53 +0000 (10:59 +0000)]
Auto merge of #5930 - ebroto:dev_newlint_fix_lt, r=matthiaskrgr
Fix cargo dev new_lint for late lint passes
Since https://github.com/rust-lang/rust-clippy/commit/
30c046ede47ea45a772d2656b0365a4807263bca , `LateLintPass` has only one lifetime parameter.
I'm not sure how to easily test this, I think adding this kind of tests would be probably part of #5394
changelog: none
Eduardo Broto [Sun, 23 Aug 2020 10:05:34 +0000 (12:05 +0200)]
Fix ICE in `repeat_once` lint
Eduardo Broto [Sun, 23 Aug 2020 09:29:06 +0000 (11:29 +0200)]
Improve documentation related to the sync process
Eduardo Broto [Thu, 20 Aug 2020 21:47:04 +0000 (23:47 +0200)]
Fix cargo dev new_lint for late lint passes
bors [Sat, 22 Aug 2020 18:30:39 +0000 (18:30 +0000)]
Auto merge of #5941 - ThibsG:InlineInCopyPassByRef, r=yaahc
Don't lint if it has always inline attribute
Don't trigger the lint `trivially_copy_pass_by_ref` if it has `#[inline(always)]` attribute.
Note: I am not particularly familiar with `inline` impacts, so I implemented this the way that if only `#[inline]` attribute is here (without `always`), the lint will still trigger. Also, it will still trigger if it has `#[inline(never)]`.
Just tell me if it sounds too much conservative.
Fixes: #5876
changelog: none
bors [Sat, 22 Aug 2020 12:50:22 +0000 (12:50 +0000)]
Auto merge of #5929 - stchris:issues/5917, r=ebroto
Widen understanding of prelude import
Prelude imports are exempt from wildcard import warnings. Until now only
imports of the form
```
use ...::prelude::*;
```
were considered. This change makes it so that the segment `prelude` can
show up anywhere, for instance:
```
use ...::prelude::v1::*;
```
Fixes #5917
changelog: Allow `prelude` to appear in any segment of the import path in [`wildcard_imports`]
Christian Stefanescu [Fri, 21 Aug 2020 12:03:42 +0000 (14:03 +0200)]
Use more elegant way to check for prelude string
Christian Stefanescu [Thu, 20 Aug 2020 20:54:46 +0000 (22:54 +0200)]
Run sh tests/ui/update-all-references.sh
Christian Stefanescu [Thu, 20 Aug 2020 20:49:39 +0000 (22:49 +0200)]
Widen understanding of prelude import
Prelude imports are exempt from wildcard import warnings. Until now only
imports of the form
```
use ...::prelude::*;
```
were considered. This change makes it so that the segment `prelude` can
show up anywhere, for instance:
```
use ...::prelude::v1::*;
```
Fixes #5917
ThibsG [Sat, 22 Aug 2020 08:35:18 +0000 (10:35 +0200)]
Don't lint if it has always inline attribute
bors [Sat, 22 Aug 2020 06:19:42 +0000 (06:19 +0000)]
Auto merge of #5934 - ThibsG:WrongSelfTestCase4037, r=ebroto
Add async test case for FP in `wrong_self_convention` lint
Closes: #4037
changelog: none
r? @ebroto
ThibsG [Fri, 21 Aug 2020 06:18:05 +0000 (08:18 +0200)]
Add async test case for `wrong_self_convention` lint
bors [Sat, 22 Aug 2020 04:51:38 +0000 (04:51 +0000)]
Auto merge of #5926 - giraffate:improve_lint_message_in_to_string_in_display, r=yaahc
Improve lint message in `to_string_in_display`
This is a follow-up of https://github.com/rust-lang/rust-clippy/pull/5831.
changelog: none
bors [Fri, 21 Aug 2020 23:43:20 +0000 (23:43 +0000)]
Auto merge of #5933 - mikerite:fix-5927, r=matthiaskrgr
Fix false negative in `option_as_ref_deref`
Closes #5927
changelog: Fix false negative in `option_as_ref_deref`
bors [Fri, 21 Aug 2020 23:10:59 +0000 (23:10 +0000)]
Auto merge of #5938 - ebroto:sync-from-rust, r=ebroto
Rustup
r? @ghost
changelog: none
Eduardo Broto [Fri, 21 Aug 2020 22:59:42 +0000 (00:59 +0200)]
run cargo dev fmt
Eduardo Broto [Fri, 21 Aug 2020 22:53:03 +0000 (00:53 +0200)]
Merge remote-tracking branch 'upstream/master' into sync-from-rust
Michael Wright [Fri, 21 Aug 2020 05:23:04 +0000 (07:23 +0200)]
Fix false negative in `option_as_ref_deref`
bors [Thu, 20 Aug 2020 22:09:27 +0000 (22:09 +0000)]
Auto merge of #5928 - mikerite:fix-5924, r=ebroto
Fix false positive in `PRECEDENCE` lint
Extend the lint to handle chains of methods combined with unary negation.
Closes #5924
changelog: Fix false negative in `PRECEDENCE` lint
bors [Thu, 20 Aug 2020 10:04:46 +0000 (10:04 +0000)]
Auto merge of #5919 - ebroto:5747_from_bits_in_const, r=matthiaskrgr
transmute: avoid suggesting from/to bits in const
changelog: Avoid suggesting from/to bits in const contexts in [`transmute_int_to_float`]
Fixes #5747
Aaron Hill [Mon, 27 Jul 2020 22:02:29 +0000 (18:02 -0400)]
Capture tokens for Pat used in macro_rules! argument
This extends PR #73293 to handle patterns (Pat). Unlike expressions,
patterns do not support custom attributes, so we only need to capture
tokens during macro_rules! argument parsing.
Michael Wright [Thu, 20 Aug 2020 04:34:48 +0000 (06:34 +0200)]
Fix false positive in `PRECEDENCE` lint
Extend the lint to handle chains of methods combined with unary negation.
Closes #5924
Takayuki Nakata [Wed, 19 Aug 2020 13:31:34 +0000 (22:31 +0900)]
Improve lint message in `to_string_in_display`
Eduardo Broto [Tue, 18 Aug 2020 20:19:30 +0000 (22:19 +0200)]
no from/to bits in const: add tests cases for f64
Eduardo Broto [Mon, 17 Aug 2020 23:00:11 +0000 (01:00 +0200)]
transmute: avoid suggesting from/to bits in const
bors [Tue, 18 Aug 2020 17:58:40 +0000 (17:58 +0000)]
Auto merge of #5922 - flip1995:rustup, r=flip1995
Rustup
r? @ghost
changelog: none
flip1995 [Tue, 18 Aug 2020 17:10:52 +0000 (19:10 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup
bors [Mon, 17 Aug 2020 23:16:08 +0000 (23:16 +0000)]
Auto merge of #75120 - JulianKnodt:rm_reps, r=oli-obk
rust_ast::ast => rustc_ast
Rework of #71199 which is a rework #70621
Still working on this but just made the PR to track progress
r? @Dylan-DPC
Ujjwal Sharma [Mon, 27 Apr 2020 17:56:11 +0000 (23:26 +0530)]
rust_ast::ast => rustc_ast
bors [Mon, 17 Aug 2020 16:49:03 +0000 (16:49 +0000)]
Auto merge of #5908 - giraffate:fix_fp_for_same_item_push, r=flip1995
Fix FP for `same_item_push`
Fixes https://github.com/rust-lang/rust-clippy/issues/5902
changelog: Fix FP for `same_item_push` where the pushed variable is mutated.
David Wood [Tue, 4 Aug 2020 13:24:13 +0000 (14:24 +0100)]
clippy: support `QPath::LangItem`
This commit updates clippy with the introduction of `QPath::LangItem` so
that it still compiles.
Signed-off-by: David Wood <david@davidtw.co>
bors [Mon, 17 Aug 2020 12:23:44 +0000 (12:23 +0000)]
Auto merge of #5915 - matthiaskrgr:deps_, r=Manishearth
deps: bump cargo_metadata and semver
cargo_metadata 0.9.1 -> 0.11.1
semver 0.9.0 -> 0.10.0
changelog: none
Matthias Krüger [Mon, 17 Aug 2020 10:19:32 +0000 (12:19 +0200)]
deps: bump cargo_metadata and semver
cargo_metadata 0.9.1 -> 0.11.1
semver 0.9.0 -> 0.10.0
Takayuki Nakata [Sun, 16 Aug 2020 23:36:02 +0000 (08:36 +0900)]
Improve code style
bors [Sun, 16 Aug 2020 21:56:37 +0000 (21:56 +0000)]
Auto merge of #5894 - tmiasko:self-assignment, r=Manishearth
Warn about explicit self-assignment
Warn about assignments where left-hand side place expression is the same
as right-hand side value expression. For example, warn about assignment in:
```rust
pub struct Event {
id: usize,
x: i32,
y: i32,
}
pub fn copy_position(a: &mut Event, b: &Event) {
a.x = b.x;
a.y = a.y;
}
```
changelog: New lint `self_assignment`, checks for explicit self-assignments.
Tomasz Miąsko [Sun, 16 Aug 2020 00:00:00 +0000 (00:00 +0000)]
Warn about explicit self-assignment
Warn about assignments where left-hand side place expression is the same
as right-hand side value expression. For example, warn about assignment in:
```rust
pub struct Event {
id: usize,
x: i32,
y: i32,
}
pub fn copy_position(a: &mut Event, b: &Event) {
a.x = b.x;
a.y = a.y;
}
```
Tomasz Miąsko [Sun, 16 Aug 2020 00:00:00 +0000 (00:00 +0000)]
Expresions with Assign / AssignOp have side effects
Tomasz Miąsko [Sun, 16 Aug 2020 00:00:00 +0000 (00:00 +0000)]
Rename SpanlessEq::ignore_fn to deny_side_effects
No functional changes intended.
Tomasz Miąsko [Sun, 16 Aug 2020 00:00:00 +0000 (00:00 +0000)]
Introduce function for comparing expression values
Introduce `eq_expr_value(cx, a, b)` as a shortcut for
`SpanlessEq::new(cx).ignore_fn().eq_expr(cx, a, b)`.
No functional changes intended.
bors [Sun, 16 Aug 2020 20:27:43 +0000 (20:27 +0000)]
Auto merge of #5720 - bugadani:new-lint, r=flip1995,yaahc
Add unnecessary lazy evaluation lint
changelog: Add [`unnecessary_lazy_evaluations`] lint that checks for usages of `unwrap_or_else` and similar functions that can be simplified.
Closes #5715
Dániel Buga [Sun, 16 Aug 2020 20:16:39 +0000 (22:16 +0200)]
Rename lint to use plural form
Dániel Buga [Sun, 16 Aug 2020 19:33:29 +0000 (21:33 +0200)]
Fix missed rename
bors [Sun, 16 Aug 2020 19:27:27 +0000 (19:27 +0000)]
Auto merge of #5913 - HactarCE:patch-1, r=flip1995
Fix typo in description of unnecessary_mut_passed
changelog: Correct "immutable reference" to "mutable reference" in description of `unnecessary_mut_passed`
Dániel Buga [Sun, 16 Aug 2020 19:04:02 +0000 (21:04 +0200)]
Fix dogfooding test errors
Dániel Buga [Sun, 16 Aug 2020 18:51:16 +0000 (20:51 +0200)]
run cargo dev fmt
Dániel Buga [Sun, 16 Aug 2020 18:50:30 +0000 (20:50 +0200)]
Cleanup, explain return value
Dániel Buga [Sun, 16 Aug 2020 18:47:50 +0000 (20:47 +0200)]
Moved to submodule, don't trigger if map_unwrap_or does
Hactar [Sun, 16 Aug 2020 18:43:34 +0000 (14:43 -0400)]
Fix typo in description of unnecessary_mut_passed
Dániel Buga [Sun, 26 Jul 2020 19:08:07 +0000 (21:08 +0200)]
Apply suggested change
Co-authored-by: Philipp Krones <hello@philkrones.com>
Dániel Buga [Sun, 26 Jul 2020 18:52:00 +0000 (20:52 +0200)]
Apply suggested change
Co-authored-by: Philipp Krones <hello@philkrones.com>
Dániel Buga [Sun, 26 Jul 2020 18:18:12 +0000 (20:18 +0200)]
Removed the extra lifetime parameter
Dániel Buga [Mon, 15 Jun 2020 18:01:18 +0000 (20:01 +0200)]
Catch function calls in argument lists, add tests that tuples don't get linted
Dániel Buga [Mon, 15 Jun 2020 13:22:22 +0000 (15:22 +0200)]
Run cargo dev update_lints
Dániel Buga [Mon, 15 Jun 2020 13:26:02 +0000 (15:26 +0200)]
Also simplify if the closure body is an index expression
Dániel Buga [Mon, 15 Jun 2020 12:55:23 +0000 (14:55 +0200)]
Add note to `or_fun_call`, list checked methods
Dániel Buga [Mon, 15 Jun 2020 09:48:14 +0000 (11:48 +0200)]
Rename the changelog footnote as well
Dániel Buga [Mon, 15 Jun 2020 09:21:56 +0000 (11:21 +0200)]
Implement new lint
bors [Sun, 16 Aug 2020 17:51:18 +0000 (17:51 +0000)]
Auto merge of #5725 - montrivo:should-impl-trait, r=flip1995
should_impl_trait - ignore methods with lifetime params
Fixes: #5617
changelog: don't lint should_implement_trait when an `Iterator::next` case has explicit parameters
bors [Sun, 16 Aug 2020 17:30:12 +0000 (17:30 +0000)]
Auto merge of #5907 - wiomoc:feature/useless-vec-max-size, r=flip1995
appreciative too_large_for_stack in useless `vec!`
Fixes: #5847
changelog: Add `too_large_for_stack ` configuration option for `USELESS_VEC`
bors [Sun, 16 Aug 2020 17:08:45 +0000 (17:08 +0000)]
Auto merge of #5903 - jrqc:needless_return, r=ebroto,flip1995
Needless return
Fixes #5858
changelog: fix false positive [`needless_return`]
bors [Sun, 16 Aug 2020 16:41:57 +0000 (16:41 +0000)]
Auto merge of #5881 - wiomoc:feature/single-char-push_str, r=ebroto,flip1995
Lint `push_str` with a single-character string literal
Fixes #5875
changelog: `* [single_char_push_str]`
bors [Sun, 16 Aug 2020 16:21:37 +0000 (16:21 +0000)]
Auto merge of #5831 - chansuke:to_string_in_display, r=flip1995
Don't use `to_string` in impl Display
fixes #3876
this PR is derived from [Toxyxer's implementation](https://github.com/rust-lang/rust-clippy/pull/5574).
changelog: add [`to_string_in_display`] lint
bors [Sun, 16 Aug 2020 15:57:18 +0000 (15:57 +0000)]
Auto merge of #5912 - ebroto:needless_doctest_main_improvements, r=Manishearth,flip1995
Parse doctests in needless_doctest_main
This switches from text-based search to running the parser to avoid false positives. Inspired by how [rustdoc](https://github.com/rust-lang/rust/blob/
3f3250500fe152b5759c21453ba9a9129808d0d8 /src/librustdoc/test.rs#L366) handles this and by #4729.
cc @llogiq
changelog: Fix multiple false positives in [`needless_doctest_main`].
Fixes #5879
Fixes #4906
Fixes #5103
Fixes #4698
Eduardo Broto [Sat, 15 Aug 2020 22:25:54 +0000 (00:25 +0200)]
Improve needless_doctest_main by using the parser
jrqc [Fri, 14 Aug 2020 06:25:26 +0000 (09:25 +0300)]
early return removed
jrqc [Thu, 13 Aug 2020 16:30:49 +0000 (19:30 +0300)]
cargo dev update_lints
jrqc [Thu, 13 Aug 2020 16:24:34 +0000 (19:24 +0300)]
Modifications according to the code review
jrqc [Thu, 13 Aug 2020 12:21:09 +0000 (15:21 +0300)]
Known problems changed
jrqc [Thu, 13 Aug 2020 12:14:08 +0000 (15:14 +0300)]
Borrow checker added
jrqc [Wed, 12 Aug 2020 14:14:12 +0000 (17:14 +0300)]
Visitor added
jrqc [Wed, 12 Aug 2020 12:43:44 +0000 (15:43 +0300)]
Make needless_return a late lint pass
bors [Sat, 15 Aug 2020 12:05:11 +0000 (12:05 +0000)]
Auto merge of #5910 - flip1995:rustup, r=flip1995
Rustup
r? @ghost
changelog: none
Christoph Walcher [Fri, 14 Aug 2020 23:40:47 +0000 (01:40 +0200)]
elide lifetimes
Christoph Walcher [Fri, 14 Aug 2020 10:52:19 +0000 (12:52 +0200)]
Merge lint with `single_char_pattern`
Christoph Walcher [Sun, 9 Aug 2020 15:47:11 +0000 (17:47 +0200)]
Lint `push_str` with a single-character string literal
Fixes #5875
Takayuki Nakata [Fri, 14 Aug 2020 13:54:12 +0000 (22:54 +0900)]
Fix FP for `same_item_push`
Don't emit a lint when `pushed_item` was declared as mutable variable.
chansuke [Wed, 22 Jul 2020 12:44:53 +0000 (21:44 +0900)]
Don't use `to_string` in impl Display
Christoph Walcher [Fri, 14 Aug 2020 12:13:35 +0000 (14:13 +0200)]
appreciative too_large_for_stack in useless `vec!`
Fixes: #5847
bors [Thu, 13 Aug 2020 19:54:48 +0000 (19:54 +0000)]
Auto merge of #5905 - ErichDonGubler:patch-1, r=flip1995
docs: typo in `temporary_cstring_as_ptr`: s/point/&s
changelog: none
Erich Gubler [Thu, 13 Aug 2020 19:52:21 +0000 (13:52 -0600)]
docs: typo in `temporary_cstring_as_ptr`: s/point/&s
Bastian Kauschke [Wed, 12 Aug 2020 10:22:56 +0000 (12:22 +0200)]
merge `as_local_hir_id` with `local_def_id_to_hir_id`
bors [Thu, 13 Aug 2020 13:54:53 +0000 (13:54 +0000)]
Auto merge of #5901 - giraffate:add_reference_to_rustc_dev_guide, r=matthiaskrgr
Add reference to rustc-dev-guide about lint message
I think it would be better to add lint message convention to documentation. I referred to https://github.com/rust-lang/rust-clippy/pull/5888 and https://github.com/rust-lang/rust-clippy/pull/5893.
changelog: none
bors [Thu, 13 Aug 2020 13:31:55 +0000 (13:31 +0000)]
Auto merge of #5899 - JarredAllen:rc-box-suggestion, r=yaahc
Change Rc<Box<T>> recommendation to be Rc<T> instead of Box<T>
Fixes #5722
changelog: Suggest `Rc<Box<T>>` -> `Rc<T>` in [`redundant_allocation`] lint
bors [Thu, 13 Aug 2020 05:27:29 +0000 (05:27 +0000)]
Auto merge of #5900 - ThibsG:ParensUselessConversion4750, r=phansch
Fix: keep parenthesis for suggestion in `useless_conversion` lint
Note: this lint was previously named `identity_conversion`.
fixes: #4750
changelog: fix parenthesis for `useless_conversion` lint suggestion
Takayuki Nakata [Thu, 13 Aug 2020 00:02:49 +0000 (09:02 +0900)]
Add reference to rustc-dev-guide about lint message
JarredAllen [Wed, 12 Aug 2020 20:24:55 +0000 (13:24 -0700)]
Replace panics with early returns
ThibsG [Wed, 12 Aug 2020 19:37:27 +0000 (21:37 +0200)]
Fix: keep parenthesis for suggestion in `useless_conversion` lint