Eduardo Broto
cdb555f4fc
Merge commit 'bf1c6f9871f430e284b17aa44059e0d0395e28a6' into clippyup
2020-10-23 22:16:59 +02:00
Joe Richey
3807634a47
clippy_lints: Update empty_loop lint
...
We also update the documentation to note that the remediations are
different for `std` and `no_std` crates.
Signed-off-by: Joe Richey <joerichey@google.com>
2020-10-22 22:03:13 -07:00
Geoffrey Copin
02f01104bf
Add test case for negative literals
2020-10-23 00:04:27 +02:00
Geoffrey Copin
e8f12d2f02
Address review comments
2020-10-22 23:56:49 +02:00
Tim Nielens
6533d8becf
manual-unwrap-or / pr remarks, round 2
2020-10-22 23:39:59 +02:00
Andre Bogus
c693de350a
New lint: manual-range-contains
2020-10-22 08:45:21 +02:00
cgm616
e70817e712
Update tests and add known problems to docs
2020-10-21 21:21:11 -04:00
cgm616
4a4f998c39
Add new lint for undropped ManuallyDrop values
2020-10-21 21:21:11 -04:00
Daniel Smith
86f2b29d2f
Merge lints into one pass
2020-10-21 11:04:26 -04:00
Daniel Smith
d8c6bce440
Convert the await holding lints to correctness
2020-10-21 11:04:26 -04:00
Daniel Smith
ee20ebadaf
Move refcell lint into shared module
2020-10-21 11:04:26 -04:00
Daniel Smith
3ed69cdb13
Move existing lint into shared file
2020-10-21 11:04:26 -04:00
Daniel Smith
57bf80f776
Add lint for holding RefCell Ref across an await
2020-10-21 11:04:26 -04:00
Tim Nielens
65b52d84f8
needless-lifetime / multiple where clause predicates regression
2020-10-20 00:42:00 +02:00
bors
eaffd0e418
Auto merge of #6167 - ThibsG:IdenticalArgumentsAssertEq3574, r=ebroto
...
Identical arguments on assert macro family
Lint when identical args are used on `assert_eq!`, `debug_assert_eq!`, `assert_ne!` and `debug_assert_ne!` macros.
Added to the lint `eq_op`.
Common functions added to `utils/higher.rs`
Fixes : #3574
Fixes : #4694
changelog: Lint on identical args when calling `assert_eq!`, `debug_assert_eq!`, `assert_ne!` and `debug_assert_ne!` macros
2020-10-19 19:50:12 +00:00
Patrick José Pereira
ec23db9496
Add linter for a single element for loop
...
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2020-10-19 09:53:35 -03:00
Takayuki Nakata
be136b2712
Merge remote-tracking branch 'upstream/master' into sync-from-rust
2020-10-19 13:05:51 +09:00
Takayuki Nakata
114cb218f3
Remove an extra blank line in doc examples
2020-10-19 10:34:01 +09:00
Tim Nielens
915ce36087
manual_unwrap_or / support Result::unwrap_or
2020-10-18 01:18:59 +02:00
Eduardo Broto
bc43862820
Merge remote-tracking branch 'upstream/master' into rustup
2020-10-17 21:55:46 +02:00
Yuki Okushi
82f775d2c4
Rollup merge of #77851 - exrook:split-btreemap, r=dtolnay
...
BTreeMap: refactor Entry out of map.rs into its own file
btree/map.rs is approaching the 3000 line mark, splitting out the entry
code buys about 500 lines of headroom.
I've created this PR because the changes I've made in #77438 will push `map.rs` over the 3000 line limit and cause tidy to complain.
I picked `Entry` to factor out because it feels less tightly coupled to the rest of `BTreeMap` than the various iterator implementations.
Related: #60302
2020-10-18 04:11:07 +09:00
Jacob Hughes
29392a1728
Appease the almightly lord clippy, hallowed be thy name
2020-10-17 13:48:54 -04:00
Geoffrey Copin
bb0ce32423
Lint unnecessary int-to-int and float-to-float casts
2020-10-17 16:12:51 +02:00
ThibsG
5a13217ea9
Assert macro args extractor as a common function in higher
2020-10-17 11:54:25 +02:00
bors
4e83a38618
Auto merge of #6123 - montrivo:less_concise_than, r=ebroto
...
add lint manual_unwrap_or
Implements partially #5923 .
changelog: add lint manual_unwrap_or
2020-10-16 20:43:45 +00:00
Santiago Pastorino
0af467ebf2
Handle ExprKind::ConstBlock on clippy
2020-10-16 17:14:34 -03:00
Eduardo Broto
701c7e2fba
bump cargo_metadata version
2020-10-16 22:11:37 +02:00
bors
e351e5ca69
Auto merge of #6180 - flip1995:rustup, r=flip1995
...
Update semver 0.10 -> 0.11
r? `@ghost,` blocking CI
changelog: none
2020-10-16 12:24:23 +00:00
flip1995
6d358d29b0
Update semver 0.10 -> 0.11
2020-10-16 14:23:17 +02:00
bors
a771557ee9
Auto merge of #6178 - josephlr:sync-from-rust, r=phansch
...
Sync from rust
Fix rustc breakage by running:
```rust
git subtree push -P src/tools/clippy git@github.com:josephlr/rust-clippy sync-from-rust
```
and then adding a commit that runs `cargo dev fmt`
---
changelog: none
2020-10-16 07:45:42 +00:00
Joe Richey
ef91de6402
Run cargo dev fmt
...
Signed-off-by: Joe Richey <joerichey@google.com>
2020-10-15 22:37:53 -07:00
est31
2c1e8cfc62
Remove rustc_session::config::Config
...
The wrapper type led to tons of target.target
across the compiler. Its ptr_width field isn't
required any more, as target_pointer_width
is already present in parsed form.
2020-10-15 12:02:24 +02:00
Chris Ayoup
32e2021b75
Lint items after statements in macro expansions
...
The items_after_statements lint was skipping all expansions. Instead
we should still lint local macros.
Fixes #578
2020-10-14 23:49:48 -04:00
Tim Nielens
690a6a6c0e
manual-unwrap-or / remove unwrap_or_else suggestion due to ownership issues
2020-10-14 22:52:07 +02:00
Tim Nielens
a8fb69f065
manual-unwrap-or / more pr remarks
2020-10-14 22:16:48 +02:00
Tim Nielens
fc846c37fc
manual_unwrap_or / use consts::constant_simple helper
2020-10-14 22:16:48 +02:00
Tim Nielens
6d4eeeabcd
manual-unwrap-or / pr remarks
2020-10-14 22:16:48 +02:00
Tim Nielens
9c9327980b
manual-unwrap-or / rename files
2020-10-14 22:16:48 +02:00
Tim Nielens
07b2da884c
add lint less_concise_than_option_unwrap_or
2020-10-14 22:16:48 +02:00
Xidorn Quan
e82264860d
Add a known problem for transmute_ptr_to_ref lint
2020-10-14 23:15:01 +11:00
ThibsG
121a047645
Move linting of assert
macros from early to late pass
2020-10-13 23:57:22 +02:00
bors
0b77c35965
Auto merge of #6169 - ThibsG:SameFunctionsInIfConditionIgnoreMacro, r=ebroto
...
Fix FP in `same_functions_in_if_condition` lint about condition as macro
Ignore expr that originate from a macro.
Fixes : #6168
changelog: none
2020-10-13 16:01:11 +00:00
Eduardo Broto
cd82a29ad1
Merge remote-tracking branch 'upstream/master' into rustup
2020-10-13 17:16:14 +02:00
ThibsG
e2124086b8
Fix FP in same_functions_in_if_condition
lint about condition as macro
2020-10-13 11:31:13 +02:00
ThibsG
a3e0446afe
Extend to the assert
macro family
2020-10-13 09:31:53 +02:00
ThibsG
32fdb8fb0c
Lint on identical variable used as args in assert_eq!
macro call
2020-10-12 23:38:31 +02:00
Eduardo Broto
74ae116131
Use lowercase in error messages
2020-10-11 22:28:55 +02:00
Andre Bogus
6021c23159
New lint: result-unit-err
2020-10-11 22:04:59 +02:00
Jonas Schievink
1178777457
Refactor how SwitchInt stores jump targets
2020-10-10 17:46:11 +02:00
bors
7118d37bf8
Auto merge of #6154 - flip1995:ice_fixes, r=ebroto
...
Fix two ICEs caused by ty.is_{sized,freeze}
Fixes #6153
Properly fixes #6139
The test case in #6153 is kind of weird. Even removing one of the arguments of the `foo` function prevented the ICE. I think this test case is actually minimal.
changelog: none
2020-10-10 13:29:05 +00:00