Commit graph

3528 commits

Author SHA1 Message Date
bors
8e9089e454 Auto merge of #5110 - Aloso:patch-1, r=flip1995
Fix syntax highlighting of code fences

The documentation for RESULT_EXPECT_USED includes this code:

    let res: Result<usize, ()> = Ok(1);
    res?;
    # Ok::<(), ()>(())

Because the code fence didn't start with `rust`, the code wasn't highlighted and the line starting with `#` was displayed on the website. This is now fixed.

EDIT: I noticed that highlighting for some other lints is broken as well. It only works if the code fence looks like this:

````markdown
```rust
// ..
```
````

However, many code blocks were ignored. I un-ignored most code blocks and made them compile by adding hidden code with `#`. While doing so, I found two mistakes:

```rust
opt.map_or(None, |a| a + 1)
// instead of
opt.map_or(None, |a| Some(a + 1))
```
and

```rust
fn as_str(self) -> &str
// instead of
fn as_str(self) -> &'static str
```

changelog: none
2020-01-30 23:24:53 +00:00
Ludwig Stecher
1f600f3f9a Un-ignore most code blocks to render correctly on website, correct mistakes 2020-01-30 23:44:37 +01:00
Ludwig Stecher
58da5ba6db Fix code formatting for more lints 2020-01-30 22:12:00 +01:00
Ludwig Stecher
f0dc98160b
Fix syntax highlighting of code fence
The documentation for RESULT_EXPECT_USED includes this code:

    let res: Result<usize, ()> = Ok(1);
    res?;
    # Ok::<(), ()>(())

Because the code fence didn't start with `rust`, the code wasn't highlighted and the line starting with `#` was displayed on the website. This is now fixed.
2020-01-30 21:55:30 +01:00
Areredify
63ab7a5e8c lint all guard types, not just lock functions 2020-01-30 18:46:22 +03:00
Mikhail Babenko
9b88a2b295 decouple 'let_underscore' tests 2020-01-30 16:51:23 +03:00
Mikhail Babenko
d1f8621711 add lint 2020-01-30 16:48:56 +03:00
xiongmao86
ac9f019fbf Reformat code. 2020-01-30 00:23:47 +08:00
xiongmao86
512efbea23 Declare lint and implement lint logic. 2020-01-30 00:21:29 +08:00
Yuki Okushi
66524c5be0 Rustup to rust-lang/rust#68512 2020-01-29 17:15:56 +09:00
Yuki Okushi
f5e86d6894 Rename span_note_and_lint to span_lint_and_note 2020-01-27 11:26:42 +09:00
Yuki Okushi
f60f12f71f Rename span_help_and_lint to span_lint_and_help 2020-01-27 11:17:58 +09:00
bors
4f65bec39a Auto merge of #5084 - JohnTitor:clean-up-span-lint, r=flip1995
Clean up `span_lint` in `methods/mod.rs`

Uses `span_help_and_lint` instead of `span_lint` and `span_lint_and_sugg` instead of `span_lint_and_then`.

changelog: none
2020-01-26 15:28:39 +00:00
Eduard-Mihai Burtescu
0e52a0ed6d Don't use ExpnKind::descr to get the name of a bang macro. 2020-01-26 03:12:44 +02:00
Yuki Okushi
4b133f2867 Apply review comments 2020-01-26 07:01:16 +09:00
bors
fd6f609f64 Auto merge of #5083 - Areredify:issue-4399, r=flip1995
dont fire `possible_missing_comma` if intendation is present

Closes #4399
changelog: dont fire `possible_missing_comma` if intendation is present

I suspect there is already a utils function for indentation (but searching indent didn't yield a function for that), and my solution is certainly not universal, but it's probably the best we can do.
2020-01-25 17:47:54 +00:00
Mikhail Babenko
a234aef084 dont fire possible_missing_comma if intendation is present 2020-01-25 20:16:05 +03:00
bors
6b5419412e Auto merge of #5081 - Areredify:vec_box_threshold, r=flip1995
add size parameter for `vec_box`  lint

changelog: add size threshold for the `vec_box` lint, currently 4096 bytes (one page) (subject to change). Closes #3547.

diff is a little bit confusing due to some refactoring (moving free functions to lint struct functions), relevant portion is [this](https://github.com/rust-lang/rust-clippy/compare/master...Areredify:vec_box_threshold?expand=1#diff-1096120ca9143af89dcc9175ea92b54aR294-R298). In hindsight should've been different commits, but oh well.
2020-01-25 16:11:43 +00:00
Mikhail Babenko
2b7bc260de add size parameter for lint 2020-01-25 18:06:52 +03:00
bors
87597b5a42 Auto merge of #5087 - Areredify:issue-4905, r=phansch
improve `empty_enum` documentation

closes #4905
changelog: improve `empty_enum` help message and documentation.
2020-01-24 22:30:07 +00:00
Mikhail Babenko
634774b89b don't fire empty_loop in no_std crates 2020-01-24 14:42:24 +03:00
Mikhail Babenko
199ae1714e improve empty_enum documentation 2020-01-24 14:37:16 +03:00
Yuki Okushi
2dc73c45d5 Clean up methods/mod.rs 2020-01-24 17:04:37 +09:00
bors
2c7cfa8321 Auto merge of #5027 - sinkuu:vectored_io, r=phansch
Lint vectored IO in unused_io_amount lint

`read_vectored` & `write_vectored` require handling returned value likewise non-vectored methods. https://github.com/rust-lang/rust/issues/68041

---

changelog: lint vectored IO in `unused_io_amount` lint
2020-01-24 06:44:09 +00:00
bors
3237b7a69f Auto merge of #5082 - Areredify:issue-4980, r=flip1995
disable let_underscore_must_use in external macros

changelog: disable let_underscore_must_use in external macros
Closes #4980
2020-01-23 18:29:28 +00:00
Mikhail Babenko
fef3657100 disable let_underscore_must_use in external macros 2020-01-23 20:02:34 +03:00
Areredify
796958c7e2 add option_as_ref_deref lint 2020-01-23 16:12:16 +03:00
Yuki Okushi
a7d58edf27 Ignore macros with ! operators in eq_op 2020-01-22 16:48:00 +09:00
Yuki Okushi
7ce9b8437d Rustup to rust-lang/rust#68140 2020-01-22 07:26:07 +09:00
bors
dd06c06183 Auto merge of #5028 - krishna-veerareddy:issue-5026-mem-ordering-fences, r=phansch
Detect usage of invalid atomic ordering in memory fences

Detect usage of `core::sync::atomic::{fence, compiler_fence}` with `Ordering::Relaxed` and suggest valid alternatives.

changelog: Extend `invalid_atomic_ordering` to lint memory fences

Fixes #5026
2020-01-21 05:53:46 +00:00
bors
eca0d8e5d0 Auto merge of #5067 - JohnTitor:lint-skip-while-next, r=flip1995
Add `skip_while_next` lint

Fixes #4036

changelog: Add `skip_while_next` lint
2020-01-20 17:28:38 +00:00
bors
32949da78e Auto merge of #5070 - JohnTitor:suspicious-map-doc, r=flip1995
Improve `suspicious_map`documentation

Fixes #4793

changelog: none
2020-01-20 12:12:03 +00:00
Yuki Okushi
bec5b69e45 Apply review comment 2020-01-20 21:07:31 +09:00
Yuki Okushi
f8034e0bc6 Improve suspicious_mapdocumentation 2020-01-20 15:05:40 +09:00
Yuki Okushi
fdda3c3f25 Tweak wording in assertions_on_constants 2020-01-20 11:52:58 +09:00
Yuki Okushi
95c369fa91 Add skip_while_next lint 2020-01-20 10:56:02 +09:00
bors
f7b3e4f29c Auto merge of #5056 - rust-lang:dissasociate-mut-key, r=flip1995
Avoid mut_key on types of unknown layout

This fixes #5020 by requiring a known layout for the key type before linting. Edit: This fixes #5043, too.

changelog: none
2020-01-19 14:41:28 +00:00
Andre Bogus
59fd637ba1 Avoid mut_key on types of unknown layout 2020-01-19 14:49:18 +01:00
Yuki Okushi
c9f8d03f42 Treat more strange pattern 2020-01-19 21:14:47 +09:00
Yuki Okushi
7e76a19664 Apply review comments 2020-01-19 10:14:03 +09:00
Yuki Okushi
ce06ba3d30 Run update_lints 2020-01-19 10:06:08 +09:00
Yuki Okushi
aab64a21cc Reduce span range 2020-01-19 10:06:08 +09:00
Yuki Okushi
ae872fe1c7 Rename ok_if_let to if_let_some_result 2020-01-19 10:06:08 +09:00
Yuki Okushi
9e55424bdc Apply review comments 2020-01-19 10:06:08 +09:00
Yuki Okushi
9035264a8f Add suggestion in if_let_some_result 2020-01-19 10:06:08 +09:00
bors
0a7003ecf0 Auto merge of #5065 - matthiaskrgr:rustup_28, r=matthiaskrgr
rustup https://github.com/rust-lang/rust/pull/67712

slice_patterns have been stabilized.

changelog: none
2020-01-18 22:44:46 +00:00
Matthias Krüger
b2c4f09d77 rustup https://github.com/rust-lang/rust/pull/67712
slice_patterns have been stabilized.
2020-01-18 23:43:28 +01:00
bors
0964b8d192 Auto merge of #5046 - JohnTitor:order-nonminimal-bool, r=flip1995
Keep the ordering in `nonminimal_bool` lint

I believe it shouldn't cause any regression but feel free to let me know if you have a doubtful example.
Also, splits up `booleans` ui test.

Fixes #5045

changelog: none
2020-01-18 19:51:46 +00:00
bors
ee06aa990f Auto merge of #5063 - JohnTitor:allow-correctly, r=flip1995
Allow `unused_self` lint at the function level

Another approach of #5062.
Fixes #5053

changelog: Allow `unused_self` lint at the function level
2020-01-18 16:58:30 +00:00
Yuki Okushi
ff0a22d99f Allow unused_self lint at the function level 2020-01-18 21:05:42 +09:00
Andre Bogus
ff5fb19bbd Downgrade range_plus_one to pedantic 2020-01-18 09:40:36 +01:00
Yuki Okushi
e72f0e61c6 Rustup to rust-lang/rust#68204 2020-01-18 14:39:18 +09:00
Brad Sherman
32337a9b58 Add lint for default lint description
- Lint for any new lints that have the default lint description
  from the automation
2020-01-15 21:23:08 -06:00
bors
be09bb47db Auto merge of #5034 - ThibsG:MatchWildErrArmImprove5024, r=flip1995
Match wild err arm improvements

This lint should trigger on other identifiers which have `_` prefix (such as `_e`) and only if they are unused in the panic block.

_Note_: the `is_unused` function is greatly inspired from `pat_is_wild` function in [loops lints](43ac9416d9/clippy_lints/src/loops.rs (L1689)).
I've been considering doing some refactoring, maybe in utils. Maybe this PR or a new one. What do you think ?

fixes #5024

changelog: none
2020-01-15 21:17:21 +00:00
Andre Bogus
2797b64f7e Omit doc safety/errors header checking for main 2020-01-14 18:20:56 +01:00
bors
c24a42289b Auto merge of #4543 - xiongmao86:issue4503, r=flip1995
Fix issue4503

Fixes #4503.

changelog: Add a lint checking user are using FileType.is_file() method and suggest using !FileType.is_dir().

- [x] Followed [lint naming conventions][lint_naming]
- [x] Added passing UI tests (including committed `.stderr` file)
- [x] `cargo test` passes locally
- [x] Executed `./util/dev update_lints`
- [x] Added lint documentation
- [x] Run `./util/dev fmt`
2020-01-13 22:09:39 +00:00
Yuki Okushi
73e525019d Fix the ordering on nonminimal_bool 2020-01-14 07:08:45 +09:00
ThibsG
44fb8b5e88 Extract visitor to utils 2020-01-13 16:50:11 +01:00
ThibsG
d3c76b5b2a Change note message 2020-01-13 16:25:35 +01:00
ThibsG
95cc500e9d Fix formatting 2020-01-13 16:25:35 +01:00
ThibsG
e5c9073f9c Better binding name on Err for note 2020-01-13 16:25:35 +01:00
ThibsG
f79c47f28d Match underscore-prefixed variable also 2020-01-13 16:25:35 +01:00
Yuki Okushi
ce1c6b285d Rustup to rust-lang/rust#68045 2020-01-13 21:55:57 +09:00
xiongmao86
2b477f361e Update lints again. 2020-01-12 19:54:17 +08:00
xiongmao86
77c48ca341 Fix grammar error. 2020-01-12 19:54:17 +08:00
Rui
1018b78f41 Update clippy_lints/src/methods/mod.rs
Co-Authored-By: Philipp Krones <hello@philkrones.com>
2020-01-12 19:54:17 +08:00
xiongmao86
8d3cc6b8a9 Change lint message. 2020-01-12 19:54:17 +08:00
xiongmao86
2909bc372f ./util/dev update_lints. 2020-01-12 19:54:17 +08:00
Rui
a73822d3b9 Fix documents and messages.
Update clippy_lints/src/methods/mod.rs
2020-01-12 19:54:17 +08:00
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
Krishna Sai Veera Reddy
e2e40f2570 Detect usage of invalid atomic ordering in memory fences
Detect usage of `core::sync::atomic::{fence, compiler_fence}`
with `Ordering::Relaxed` and suggest valid alternatives.
2020-01-09 09:49:15 -08:00
Shotaro Yamada
b3971fdd5d Lint vectored IO in unused_io_amount lint 2020-01-09 23:46:55 +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
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