Commit graph

2694 commits

Author SHA1 Message Date
Joe Frikker
60a80849ce Adding try_err lint 2019-06-22 16:37:05 -04:00
bors
c5d1ecd474 Auto merge of #4220 - d-dorazio:4182-needless-return-void-functions, r=flip1995
make needless_return work with void functions

fixes https://github.com/rust-lang/rust-clippy/issues/4181.

changelog: make needless_return work with void functions.

I don't think the failure is related to my changes, but I'm not sure 🤔
2019-06-22 09:38:53 +00:00
Lzu Tao
6aea41e050 Fix fallout cause NodeId pruning 2019-06-22 13:41:16 +07:00
Daniele D'Orazio
66dbc02b05 more idiomatic code 2019-06-21 14:46:34 +02:00
flip1995
6dc8084788
Remove another unnecessary lifetime 2019-06-21 14:41:52 +02:00
Jeremy Stucki
746fbad98a
Remove needless lifetimes 2019-06-21 14:41:19 +02:00
Daniele D'Orazio
e1a78ae528 update tests and fix lints in clippy 2019-06-21 14:17:59 +02:00
Daniele D'Orazio
6396a7a425 make needless_return work with void functions 2019-06-21 13:58:22 +02:00
flip1995
ca2ba973a7
Remove unnecssary lifetime from trait_ref_of_method 2019-06-21 12:32:39 +02:00
Michael Wright
837b5208f7 Fix breakage due to rust-lang/rust#61968 2019-06-21 08:14:07 +02:00
Lzu Tao
4fa498a3eb Fix warnings about unnecessary lifetime bounds
Rustup https://github.com/rust-lang/rust/pull/61172
2019-06-20 01:36:23 +07:00
Lzu Tao
5e887b2a6a Fix lifetime mismatch between LateContext and Ty 2019-06-19 17:21:53 +07:00
Lzu Tao
321779979a Fix missing field in ExprKind::Yield
Rustup rust-lang/rust#61941
2019-06-19 16:59:25 +07:00
bors
97f8caabf6 Auto merge of #4210 - dtolnay:division, r=flip1995
Downgrade integer_division to restriction

I believe that this lint falls outside of the scope of opinionated pedantism of the other pedantic lints.

changelog: Downgrade integer_division lint from pedantic to restriction
2019-06-19 07:57:27 +00:00
Philipp Hansch
ebce573006
Refactor: Replace NodeSet with HirIdSet
This saves us one HirId -> NodeId conversion.
2019-06-18 19:45:01 +02:00
Matthias Krüger
4d984dc6e6 rustup https://github.com/rust-lang/rust/pull/61836/ 2019-06-18 11:15:47 +02:00
Daniele D'Orazio
be14ea8c37 fix suggestion for floating points inequality
It should be of the form `(a - b).abs() > error` whereas it was
`(a - b).abs() < error` that is instead what should be used for equality.
2019-06-17 16:42:43 +02:00
David Tolnay
f88a387c3f
Downgrade integer_division to restriction 2019-06-15 00:17:04 -07:00
Lzu Tao
9bfdbd13c2 Fix wrong lifetime of TyCtxt 2019-06-14 23:47:48 +07:00
krk
fefa7e7f67
Register rename to the LintStore. 2019-06-14 10:45:03 +02:00
krk
55740219b0
Rename REDUNDANT_STATIC_LIFETIME to REDUNDANT_STATIC_LIFETIMES. 2019-06-14 10:45:03 +02:00
Kerem
3b1080542b
Remove pub from RedundantStaticLifetime.visit_type function.
Co-Authored-By: Philipp Krones <hello@philkrones.com>
2019-06-14 10:45:02 +02:00
krk
637e92d44e
Rename const_static_lifetime to redundant_static_lifetime. 2019-06-14 10:45:02 +02:00
krk
b38ce08e76
Merge StaticConst and StaticStatic lints into StaticConst. 2019-06-14 09:41:47 +02:00
krk
87e9dee884
Use RedundantStaticLifetime in StaticStatic. 2019-06-14 09:41:47 +02:00
krk
ff1b533c13
Move type-checking logic in StaticConst to RedundantStaticLifetime. 2019-06-14 09:41:46 +02:00
krk
16bd4796e9
Add lint for statics with explicit static lifetime. 2019-06-14 09:41:46 +02:00
bors
7b2a7a2257 Auto merge of #4201 - mgr-inz-rafal:typos_in_docs, r=matthiaskrgr
Typos and minor grammar corrections

Just some minor grammar issues and typos in documentation.
2019-06-13 05:01:02 +00:00
Lzu Tao
3832a8d253 Fix wrong lifetime of TyCtxt 2019-06-13 02:49:02 +07:00
mgr-inz-rafal
7ced26d863 Typos and minor grammar corrections 2019-06-12 20:07:10 +02:00
Thiago Arrais
b364eb7b54 Adds lint for integer division 2019-06-12 09:37:14 -03:00
Grzegorz
d4ad23bb3f redundant_closure_for_method_calls fixes:
lint does not trigger when there is a difference in mutability
lint does not trigger when the method belongs to a trait which is not implemebted directly (Deref)
2019-06-12 13:43:36 +02:00
bors
bd33a97cc4 Auto merge of #4199 - flip1995:implicit_return_docs, r=flip1995
Fix implicit_return docs

Resolves #4197

changelog: none
2019-06-12 09:58:24 +00:00
flip1995
310c90abb8
Fix implicit_return docs 2019-06-12 10:51:14 +02:00
Matthias Krüger
7c91fb8ded rustup https://github.com/rust-lang/rust/pull/61758/files 2019-06-12 10:28:58 +02:00
Lzu Tao
79e3c7cd55 Remove wrong lifetime from LintContext 2019-06-12 10:28:52 +02:00
bors
ba1702a05f Auto merge of #4190 - projedi:fix-eta, r=flip1995
Fixing eta with respect to lazy evaluation.

This fixes #4187

changelog: `redundant_closure`: stop linting on expressions returning a function, which is then directly used by the closure
2019-06-10 19:03:18 +00:00
Alexander Shabalin
86bab94631 Fixing eta with respect to lazy evaluation. 2019-06-10 13:58:40 +03:00
Matthias Krüger
7d83e13660 rustup https://github.com/rust-lang/rust/pull/61669/ 2019-06-09 15:21:28 +02:00
Michael Wright
b726b41daf Add OUTER_EXPN_INFO lint 2019-06-08 13:35:04 +02:00
bors
71be6f62fa Auto merge of #4177 - mikerite:compiler_lint_functions_fewer_strings, r=phansch
Remove `to_string()`s from CompilerLintFunctions

changelog: none
2019-06-06 10:25:13 +00:00
bors
5be4e71262 Auto merge of #4136 - euclio:println-writeln-suggestions, r=flip1995
add suggestions for print/write with newline lint

changelog: Add machine-applicable suggestions for `print!`/`write!` with newline lints.
2019-06-06 08:26:48 +00:00
Matthias Krüger
d0ca09883e rustup https://github.com/rust-lang/rust/pull/57428/ 2019-06-06 09:21:19 +02:00
Michael Wright
b36d7a0c61 Remove to_string()s from CompilerLintFunctions 2019-06-06 07:12:12 +02:00
bors
42f96b2558 Auto merge of #4164 - mikerite:fix-4144, r=mikerite
Fix .map(..).unwrap_or_else(..) bad suggestion

Closes #4144
2019-06-04 06:28:23 +00:00
mikerite
3b7d6eeb4f
Fix comment grammar
Co-Authored-By: Philipp Krones <hello@philkrones.com>
2019-06-04 08:27:31 +02:00
bors
28a39e9741 Auto merge of #4165 - BO41:needless_range_loop, r=phansch
Add example to needless_range_loop

adds a "could be written as" example

btw, is it correct that the lint triggers even if the index is used not just for getting the values by index?
So that I have to add `.iter().enumerate()` to still get an index?

changelog: none
2019-06-03 08:28:15 +00:00
Lzu Tao
6c9ee51ecc Bump cargo_metadata of clippy_lints 2019-06-03 09:13:33 +07:00
BO41
dd007e4477 Change from ignore to rust 2019-06-02 20:06:50 +02:00
Mateusz Mikuła
a3ace5c3ca Cargo fmt 2019-06-02 18:58:11 +02:00