Commit graph

3613 commits

Author SHA1 Message Date
bors
d3989eef2d Auto merge of #5319 - 1tgr:master, r=flip1995
Lint for `pub(crate)` items that are not crate visible due to the visibility of the module that contains them

changelog: Add `redundant_pub_crate` lint

Closes #5274.
2020-03-23 20:35:49 +00:00
Tim Robinson
870b9e8139 nursery group -> style 2020-03-23 16:45:31 +00:00
bors
1ff81c1b6d Auto merge of #5350 - ThibsG:FixSingleBindingClosure, r=flip1995
Fix single binding closure

Fix the `match_single_binding` lint when triggered inside a closure.

Fixes: #5347

changelog: Improve suggestion for [`match_single_binding`]
2020-03-23 15:17:09 +00:00
Matthias Krüger
0f319513d2 rustup https://github.com/rust-lang/rust/pull/69968/ 2020-03-23 15:21:46 +01:00
ThibsG
badfbbbbde Fix single binding in closure 2020-03-22 10:31:30 +01:00
Tim Robinson
de9092438d Update for PR feedback 2020-03-20 22:52:53 +00:00
bors
0e5e2c4365 Auto merge of #5323 - rabisg0:fix/5284, r=flip1995
Improvement: Don't show function body in needless_lifetimes

Changes the span on which the lint is reported to point to only the
function return type instead of the entire function body.
Fixes #5284

changelog: none
2020-03-20 12:45:30 +00:00
Philipp Krones
606e3285b2
Rollup merge of #5341 - flip1995:rustup, r=flip1995
Rustup to rust-lang/rust#66131

changelog: none
2020-03-19 15:00:32 +01:00
Philipp Krones
a46675f229
Rollup merge of #5336 - matthiaskrgr:rustup_35, r=flip1995
rustup https://github.com/rust-lang/rust/pull/69920/

changelog: none
2020-03-19 15:00:31 +01:00
Philipp Krones
027706630b
Rollup merge of #5326 - matthiaskrgr:rustup_33, r=flip1995
rustup https://github.com/rust-lang/rust/pull/69838

changelog: none
2020-03-19 15:00:29 +01:00
flip1995
21aeb21b8a
Rustup to rust-lang/rust#66131 2020-03-19 14:33:10 +01:00
Matthias Krüger
b9d6bf3bfb rustup https://github.com/rust-lang/rust/pull/69920/ 2020-03-19 09:14:53 +01:00
Rabi Guha
0812a0af4c Improvement: Don't show function body in needless_lifetimes
Changes the span on which the lint is reported to point to only the
function return type instead of the entire function body.
Fixes #5284
2020-03-19 12:03:02 +05:30
bors
e004b9431d Auto merge of #5329 - matthiaskrgr:int_arith_on_ref_5328, r=flip1995
integer_arithmetic: detect integer arithmetic on references.

changelog: integer_arithmetic fix false negatives with references on integers

Fixes #5328
2020-03-18 14:56:05 +00:00
Matthias Krüger
c7c7ab23aa integer_arithmetic: detect integer arithmetic on references.
Also fixes the same for float_arithmetic.

changelog: integer_arithmetic,float_arithmetic: fix false negatives with references on integers

Fixes #5328
2020-03-18 14:52:01 +01:00
Matthias Krüger
2204bf20ae clean up a few lint docs 2020-03-18 02:50:39 +01:00
Matthias Krüger
b8effecee1 rustup https://github.com/rust-lang/rust/pull/69838 2020-03-17 10:18:22 +01:00
Matthias Krüger
a97f60b8e3 rustup https://github.com/rust-lang/rust/pull/69738 2020-03-16 18:38:30 +01:00
bors
24f6d643fe Auto merge of #5322 - phansch:or_patterns, r=matthiaskrgr
Make use of `or_patterns` feature

changelog: none
2020-03-16 12:41:04 +00:00
Tim Robinson
52208f3cf3 Lint for pub(crate) items that are not crate visible due to the visibility of the module that contains them
Closes #5274.
2020-03-16 12:21:00 +00:00
Matthias Krüger
ba0884bee3 rustup https://github.com/rust-lang/rust/pull/68944 2020-03-16 11:36:17 +01:00
Philipp Hansch
548c417ec4
Make use of or_patterns feature 2020-03-16 07:25:09 +01:00
Matthias Krüger
4d8ed5a842 rustup https://github.com/rust-lang/rust/pull/69589/ 2020-03-15 18:23:43 +01:00
Yuki Okushi
00861d100d
Rustup to rust-lang/rust#69076 2020-03-15 05:26:32 +09:00
Josh Triplett
f56b0a1b34 Document that wildcard_imports doesn't warn about use ...::prelude::*; 2020-03-13 17:07:11 +00:00
bors
8485d40a32 Auto merge of #5304 - sinkuu:redundant_clone_not_consumed, r=flip1995
Extend `redundant_clone` to the case that cloned value is not consumed

Fixes #5303.

---

changelog: Extend `redundant_clone` to the case that cloned value is not consumed
2020-03-12 20:22:31 +00:00
Yuki Okushi
3e3776666e
Rustup to rust-lang/rust#69674 2020-03-13 04:56:55 +09:00
Shotaro Yamada
d9ad33852c Use visit_place 2020-03-13 02:06:47 +09:00
Shotaro Yamada
aca64b8df7 Check for mutation 2020-03-13 01:25:18 +09:00
Shotaro Yamada
a377378528 Only fires on temporaries
`let y = x.clone()` cannot be turned into `let y = x` without moving x,
regardless of whether `y` is consumed or not.
2020-03-13 00:54:40 +09:00
Shotaro Yamada
9de642190e Extend redundant_clone to the case that cloned value is not consumed 2020-03-13 00:31:09 +09:00
bors
fdce47ba7d Auto merge of #5272 - jmeyers35:file_read_lint, r=flip1995
add lint on File::read_to_string and File::read_to_end

Adds lint `verbose_file_reads` which checks for use of File::read_to_end and File::read_to_string.

Closes https://github.com/rust-lang/rust-clippy/issues/4916

changelog: add lint on File::{read_to_end, read_to_string}
2020-03-10 22:35:15 +00:00
Jacob Meyers
a4ba1027fc add CR feedback 2020-03-10 18:00:37 -04:00
bors
23bd427f92 Auto merge of #5298 - rust-lang:needless_doc_main_code, r=flip1995,Manishearth
needless_doc_main: only check rust code

This fixes #5280 by checking the language attribute on code blocks.

---

changelog: none
2020-03-10 21:30:44 +00:00
Andre Bogus
2fa3da4869 needless_doc_main: only check rust code 2020-03-10 20:19:37 +01:00
bors
557f6848bd Auto merge of #5296 - sinkuu:fix_ice_trivial_bounds, r=flip1995
Fix ICE with trivial_bounds feature

https://github.com/rust-lang/rust/issues/69874#issuecomment-596890446

changelog: Fix ICE with trivial_bounds feature
2020-03-10 12:25:07 +00:00
Yuki Okushi
8d2a3e0a61
Use node_type_opt over node_type 2020-03-10 18:18:34 +09:00
Shotaro Yamada
227ef60a2b Fix doc 2020-03-10 13:28:45 +09:00
Shotaro Yamada
a3d9355bef Fix ICE with trivial_bounds feature 2020-03-10 13:17:35 +09:00
Matthias Krüger
5fd74a9a6a clippy_lints: readme: don't mention crates.io since it is no longer used to publish clippy. 2020-03-10 01:05:54 +01:00
Jacek Pospychala
697e3c89a7 Improve placeholder in map_unit_fn 2020-03-09 20:37:06 +01:00
bors
d8f64b6eba Auto merge of #5287 - matthiaskrgr:pat_isref, r=flip1995
redundant_pattern: take binding (ref, ref mut) into account in suggestion

fixes #5271

changelog: redundant_pattern: take binding (ref, ref mut) into account in suggestion (#5271)
2020-03-09 17:25:09 +00:00
bors
92e25bb7e1 Auto merge of #5286 - matthiaskrgr:delay_vec_creation, r=flip1995
check_pat: delay creation of the "normal" vec until we reach the branch where it is actually needed

changelog: none
2020-03-09 17:09:38 +00:00
bors
118594ffa2 Auto merge of #5291 - ThibsG:FixSingleBinding, r=flip1995
Fix match single binding when in a let stmt

Fix bad suggestion when `match_single_binding` lints when inside a local (let) statement.

Fixes #5267

changelog: none
2020-03-09 16:04:26 +00:00
ThibsG
40a04f2657 Fix match single binding when in a let stmt 2020-03-09 16:59:24 +01:00
bors
a5477c500c Auto merge of #5285 - matthiaskrgr:dep_it, r=flip1995
deps: bump itertools 0.8 -> 0.9

changelog: none
2020-03-09 14:29:40 +00:00
Vivek Ghaisas
ab6e709ee6 Improve error messages for {option,result}_map_unit_fn
Instead of saying "unit function", use the phrase the description
uses: "function that returns the unit type".

Fixes #5180.
2020-03-08 21:28:06 +00:00
Matthias Krüger
75a2300e27 redundant_pattern: take binding (ref, ref mut) into account in suggestion.
fixes #5271
2020-03-08 10:47:18 +01:00
Matthias Krüger
a412b3423e check_pat: delay creation of the "normal" vec until we reach the branch where is is actually needed 2020-03-08 02:50:33 +01:00
Matthias Krüger
806699342e deps: bump itertools 0.8 -> 0.9
changelog: none
2020-03-08 01:33:17 +01:00