Commit Graph

3354 Commits

Author SHA1 Message Date
xiongmao86
8d333a3cbb Extend spans to include !. 2020-01-12 19:54:17 +08:00
xiongmao86
3c59eaf91c Add lint logic. 2020-01-12 19:54:17 +08:00
xiongmao86
96334d0d7c Declare lint. 2020-01-12 19:54:17 +08:00
Yuki Okushi
2f4b105863 Remove references 2020-01-12 05:20:18 +09:00
Yuki Okushi
8a3a0ea2ea Rustup to rust-lang/rust#67000 2020-01-12 03:41:54 +09:00
Yuki Okushi
3bdf404076 Apply review comments 2020-01-11 23:21:09 +09:00
Yuki Okushi
39947992b5 Rustup to rust-lang/rust#67806 2020-01-11 21:50:00 +09:00
Yuki Okushi
10cf141ebb Apply review comments 2020-01-11 19:39:43 +09:00
Yuki Okushi
8daa2784c7 Rustup to rust-lang/rust#68101 2020-01-11 09:06:09 +09:00
Yuki Okushi
1d7d4e9217 Rustup to rust-lang/rust#67258 2020-01-11 09:05:51 +09:00
bors
ac795a6f3a Auto merge of #4960 - ThibsG:patterns_with_wildcard_#4640, r=flip1995
New lint: pats_with_wild_match_arm

Wildcard use with other pattern in same match arm.

The wildcard covers other(s) pattern(s) as it will match anyway.

changelog: add new lint when multiple patterns (including wildcard) are used in a match arm.

Fixes #4640.
2020-01-09 13:51:00 +00:00
Yuki Okushi
e58cfac458 Rustup to rust-lang/rust#67979 2020-01-09 16:43:51 +09:00
Yuki Okushi
c24251b5fd Rustup to rust-lang/rust#67781 2020-01-09 09:22:16 +09:00
bors
0da0ae3aa6 Auto merge of #5022 - flip1995:useless_attr, r=phansch
Fix useless_attribute suggestion

Fixes #5021

changelog: Fix [`useless_attribute`] suggestion, which tripped rustfix
2020-01-08 20:28:19 +00:00
flip1995
9ea17d42a7
Fix useless attribute suggestion 2020-01-08 17:47:01 +01:00
bors
52b9e704c6 Auto merge of #5017 - sinkuu:mir_no_opt_fallout, r=flip1995
Fix redundant_clone lint not working with PathBuf and OsString

https://github.com/rust-lang/rust-clippy/pull/4825 diabled MIR optimization in clippy, including `rustc_mir::transform::InstCombine` which reduces `&(*x)` to `x`. This PR tries to unwrap `&*` when looking into `mir::Rvalue`s.

Fixes #5014.

---

changelog: fixed `redundant_clone` lint not working with `PathBuf` and `OsString`
2020-01-08 12:09:45 +00:00
bors
c789caa454 Auto merge of #5015 - krishna-veerareddy:change-float-to-int-transmute-category, r=flip1995
Move `transmute_float_to_int` lint to `complexity`

`transmute_float_to_int` lint was accidentally added to nursery so moving it to the complexity group.

changelog: Move `transmute_float_to_int` out of nursery
2020-01-08 08:42:46 +00:00
Yuki Okushi
787106c380 Normalize lint messages in cast_precision_loss 2020-01-08 16:36:02 +09:00
Yuki Okushi
fa33681d5c Rustup to rust-lang/rust#67970 2020-01-08 15:42:54 +09:00
Shotaro Yamada
99eec3f54f Fix redundant_clone 2020-01-08 14:18:00 +09:00
Krishna Sai Veera Reddy
b793cf09f2 Move transmute_float_to_int lint to complexity
`transmute_float_to_int` lint was accidentally added to nursery
so moving it to the complexity group.
2020-01-07 15:53:19 -08:00
ThibsG
0fa0df9efb Span help without suggestion 2020-01-07 19:10:59 +01:00
ThibsG
8ae8b08e32 Change lint name to WILDCARD_IN_OR_PATTERNS 2020-01-07 18:48:16 +01:00
ThibsG
58deaad42d Handle case for non-exhaustive enums 2020-01-07 18:48:16 +01:00
ThibsG
d60c6f9398 Move to complexity and adapt test
- test wildcard_enum_match_arm has been impacted by this new lint
2020-01-07 18:48:16 +01:00
ThibsG
649af71f9e Change group and use only func call 2020-01-07 18:48:16 +01:00
ThibsG
8ec32175fa Remove useless parameters in func call 2020-01-07 18:48:16 +01:00
ThibsG
96c4198832 New lint: pats_with_wild_match_arm
- Wildcard use with other pattern in same match arm
2020-01-07 18:48:16 +01:00
Yuki Okushi
f7a93f029c Apply suggestion from code review 2020-01-07 18:38:12 +09:00
Yuki Okushi
5ac08b0cc9 Normalize lint messages 2020-01-07 18:26:55 +09:00
bors
cdd134764a Auto merge of #5010 - lzutao:recurse-remove_blocks, r=phansch
Make utils::remove_blocks non-recursive

changelog: none
2020-01-07 07:46:00 +00:00
Lzu Tao
3801d216e2 Make utils::remove_blocks non-recursive 2020-01-07 10:50:35 +07:00
Krishna Sai Veera Reddy
fe21ef4e8b Prevent doc-tests from running and fix lint description 2020-01-06 17:33:28 -08:00
Krishna Sai Veera Reddy
9e6a6069a7 Add lint to detect usage of invalid atomic ordering
Detect usage of invalid atomic ordering modes such as
`Ordering::{Release, AcqRel}` in atomic loads and
`Ordering::{Acquire, AcqRel}` in atomic stores.
2020-01-06 16:39:31 -08:00
Yuki Okushi
2213989a01 Do not trigger let_and_return lint on macros 2020-01-07 05:26:20 +09:00
Yuki Okushi
2f2eaf8b7e Rustup to rust-lang/rust#67886 2020-01-07 01:46:33 +09:00
bors
732825dcff Auto merge of #4996 - JohnTitor:rustup, r=matthiaskrgr
Rustup to rust-lang/rust#67803 and rust-lang/rust#67137

changelog: none
2020-01-05 08:41:37 +00:00
Yuki Okushi
17cfc77bd6 Rustup to rust-lang/rust#67137 2020-01-05 15:50:06 +09:00
Yuki Okushi
07f061563d Rustup to rust-lang/rust#67803 2020-01-05 15:50:06 +09:00
Andre Bogus
539cd25262 External macro check for missing_*_doc 2020-01-04 20:19:14 +01:00
Brad Sherman
ab5ff0352e Add lint for iter.nth(0)
- Encourage iter.next() rather than iter.nth(0), which is less readable
2020-01-04 11:20:11 -06:00
Brad Sherman
8ef53bf196 Fix existing iter-nth-zero violations 2020-01-04 09:00:54 -06:00
Philipp Hansch
c5178e82b4
Rustup to https://github.com/rust-lang/rust/pull/67853
Specifically caused by https://github.com/rust-lang/rust/pull/67786
2020-01-04 11:30:03 +01:00
bors
fa9b85d4df Auto merge of #4881 - krishna-veerareddy:issue-4871-use-mem-take, r=flip1995
Use `mem::take` instead of `mem::replace` when applicable

`std::mem::take` can be used to replace a value of type `T` with `T::default()` instead of `std::mem::replace`.

Fixes issue #4871

changelog: Added lint for [`mem_replace_with_default`]
2020-01-04 08:09:43 +00:00
Yuki Okushi
1102b87e3a Remove use of try! from documentation 2020-01-04 13:47:01 +09:00
Andre Bogus
47972cdf12 No #[no_mangle] must_use_candidate functions 2020-01-03 17:21:36 +01:00
bors
2e8c3c3e9e Auto merge of #4975 - JohnTitor:fix-4968, r=phansch
Fix ICE on `unsound_collection_transmute`

Fixes #4968

Check if `Ty`s are normalizable. It might show hidden false negative, I'm not sure.
Also, the regression tests are placed on two dirs, so move them to `/crashes`. I think it will be easier to find the right place.

changelog: Fix ICE on `unsound_collection_transmute`
2020-01-03 08:48:05 +00:00
bors
304edf39c3 Auto merge of #4978 - mikerite:fix-4958, r=phansch
Fix bad `explicit_into_iter_loop` suggestion

Fixes #4958

changelog: Fix bad `explicit_into_iter_loop` suggestion
2020-01-03 05:59:19 +00:00
Yuki Okushi
bf67fcf5a9 Move is_normalizable into utils 2020-01-02 11:48:06 +09:00
Michael Wright
ea829bd8c6 Fix bad explicit_into_iter_loop suggestion
Fixes #4958
2020-01-01 07:09:09 +02:00