Commit graph

3322 commits

Author SHA1 Message Date
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
Krishna Veera Reddy
84a60c3186 Prevent replace_consts lint within match patterns
Currently `replace_consts` lint applies within match patterns but
the suggestion is incorrect as function calls are disallowed in
them. To fix this we prevent the lint from firing within patterns.
2019-12-31 10:33:15 -08:00
Krishna Veera Reddy
42e4595d3a Indicate anonymous lifetimes for types 2019-12-31 09:22:35 -08:00
Krishna Veera Reddy
c09e79e226 Lint within internal macros without a suggestion 2019-12-31 09:22:35 -08:00
Krishna Veera Reddy
aa66f760c3 Destructure mem:replace arguments 2019-12-31 09:22:35 -08:00
Krishna Veera Reddy
78b4dfc57c Move mem_replace_with_default out of nursery 2019-12-31 09:22:34 -08:00
Krishna Veera Reddy
26812f733d Prevent mem_replace_with_default lint within macros
Also added test cases for internal and external macros.
2019-12-31 09:22:34 -08:00
Krishna Veera Reddy
8db319f957 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`.
2019-12-31 09:22:34 -08:00
Yuki Okushi
f922812541 Fix ICE due to normalization failure 2019-12-31 20:55:11 +09:00
Yuki Okushi
bf08998b5c Use is_empty() 2019-12-31 16:50:43 +09:00
Yuki Okushi
9086b17e14 Rustup to rust-lang/rust#67707 2019-12-31 09:17:56 +09:00
bors
3036b0e6d5 Auto merge of #4970 - krishna-veerareddy:fix-replace-consts-documentation, r=flip1995
Fix `replace_consts` lint documentation

`replace_consts` lint no longer lints for the usage of
`ATOMIC_{SIZE}_INIT` and `ONCE_INIT` so removing any
occurences of them in the documentation.

changelog: Update `replace_consts` lint documentation
2019-12-30 17:28:57 +00:00
bors
cecaca3382 Auto merge of #4634 - m-ober:feature/2320-map-or, r=llogiq
Add real suggestion to option_map_unwrap_or

changelog: Add real suggestion to `option_map_unwrap_or`

Fixes #2320
2019-12-30 15:50:06 +00:00
Krishna Veera Reddy
f533b98121 Fix replace_consts lint documentation
`replace_consts` lint no longer lints for the usage of
`ATOMIC_{SIZE}_INIT` and `ONCE_INIT` so removing any
occurences of them in the documentation.
2019-12-30 05:55:22 -08:00
Yuki Okushi
a4c201e6b4 Rustup to rust-lang/rust#66942 2019-12-30 13:02:10 +09:00
Yuki Okushi
cf76eb48de Rustup to rust-lang/rust#67151 2019-12-29 12:39:46 +09:00
Micha Ober
c5046fdce5 Add real suggestion to option_map_unwrap_or 2019-12-28 23:24:45 +01:00
bors
6bf87d5bbf Auto merge of #4964 - JohnTitor:fix-potential-ice, r=flip1995
Possibly fix an ICE on test

Fix a potential ICE on test with debug assertion, caused on rust-lang/rust#67661.
r? @oli-obk

changelog: none
2019-12-28 18:41:38 +00:00
mgr-inz-rafal
a208906afb Fixes for elided lifetimes 2019-12-28 17:14:19 +01:00
mgr-inz-rafal
f191e916bd Add new lint (modulo_arithmetic) 2019-12-28 16:46:08 +01:00
Yuki Okushi
bca125935c code review 2019-12-28 22:45:41 +09:00
Yuki Okushi
fbdb13cfb0 Possibly fix an ICE on test 2019-12-28 22:30:44 +09:00
Yuki Okushi
5962fffcfe Suggest similar lint name on unknown_clippy_lints 2019-12-27 22:07:55 +09:00
Yuki Okushi
e2636729ec Rustup to rust-lang/rust#66936 2019-12-27 16:13:53 +09:00
bors
b0c4744d57 Auto merge of #4956 - JohnTitor:decimal-lit-suffix, r=llogiq
Do not drop suffixes on `decimal_literal_representation`

Fixes #4763

changelog: Do not drop type suffixes on `decimal_literal_representation`
2019-12-25 19:39:13 +00:00
Yuki Okushi
b68e65b4da Do not drop suffixes on decimal_literal_representation 2019-12-26 01:22:36 +09:00
Yuki Okushi
ad936389e1 Correct documentation for len_zero 2019-12-25 21:06:55 +09:00
bors
a68ef55dbf Auto merge of #4947 - rust-lang:doc-main-extern-crate, r=flip1995
Avoid needless_doctest_main on 'extern crate'

This fixes #4927.

r? @flip1995

changelog: none
2019-12-24 15:03:54 +00:00
bors
1837cbce6c Auto merge of #4885 - rust-lang:mut-key-types, r=flip1995
new lint: mutable_key_type

This fixes #732 - well, partly, it doesn't adress `Hash` impls, but the use of mutable types as map keys or set members

changelog: add `mutable_key_type` lint

r? @flip1995
2019-12-24 13:32:45 +00:00
Andre Bogus
40435acf3d new lint: mutable_key_type 2019-12-24 13:46:19 +01:00
Andre Bogus
129d0cd0f4 Avoid needless_doctest_main on 'extern crate' 2019-12-24 13:42:37 +01:00
Lzu Tao
652666b288 rustup "Add span information to ExprKind::Assign" 2019-12-24 11:25:24 +07:00
Lzu Tao
f5b896451a do minor cleanups
* ToString and AsRef are in prelude, no need to import them
2019-12-24 03:06:52 +07:00