rust-clippy/clippy_lints/src
bors ffe57fad85 Auto merge of #4498 - sinkuu:checked_arithmetic_unwrap, r=flip1995
Add manual_saturating_arithmetic lint

changelog: add `manual_saturating_arithmetic` lint

Fixes #1557. This lint detects manual saturating arithmetics like `x.checked_add(10u32).unwrap_or(u32::max_value())` and suggests replacing with `x.saturating_add(10u32)`.
2019-09-04 12:14:41 +00:00
..
methods Auto merge of #4498 - sinkuu:checked_arithmetic_unwrap, r=flip1995 2019-09-04 12:14:41 +00:00
utils Auto merge of #4490 - mikerite:fix-4364, r=flip1995 2019-09-04 11:35:13 +00:00
approx_const.rs Dogfood 2019-05-18 01:42:15 +02:00
arithmetic.rs Doctests: Enable running doc tests for restriction lints 2019-08-03 21:24:50 +02:00
assertions_on_constants.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
assign_ops.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
attrs.rs Make useless_attribute suggestion MaybeIncorrect 2019-08-28 21:17:12 +02:00
bit_mask.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
blacklisted_name.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
block_in_if_condition.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
booleans.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
bytecount.rs Replace Arg with Param 2019-08-28 18:33:25 +09:00
cargo_common_metadata.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
checked_conversions.rs Doctests: Enable running doc tests for pedantic lints 2019-08-03 20:36:38 +02:00
cognitive_complexity.rs Improve cognitive_complexity lint's warning. 2019-08-29 11:54:18 +02:00
collapsible_if.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
consts.rs Remove Allocation::bytes 2019-09-03 18:29:08 +09:00
copies.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
copy_iterator.rs Doctests: Enable running doc tests for pedantic lints 2019-08-03 20:36:38 +02:00
dbg_macro.rs Rustup "Remove Spanned from {ast,hir}::FieldPat" 2019-08-16 09:32:27 +07:00
default_trait_access.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
deprecated_lints.rs Deprecate unused_collect lint 2019-08-14 21:47:11 +02:00
derive.rs Doctests: Enable running doc tests for pedantic lints 2019-08-03 20:36:38 +02:00
doc.rs Doctests: Enable running doc tests for pedantic lints 2019-08-03 20:36:38 +02:00
double_comparison.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
double_parens.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
drop_bounds.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
drop_forget_ref.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
duration_subsec.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
else_if_without_else.rs Doctests: Enable running doc tests for restriction lints 2019-08-03 21:24:50 +02:00
empty_enum.rs Rename hir::map::local_def_id_from_hir_id to local_def_id 2019-07-06 10:52:51 +07:00
entry.rs Doctests: Enable running doc tests for perf lints 2019-08-03 08:08:00 +02:00
enum_clike.rs Rustup to rust-lang/rust#63543 2019-08-15 10:14:06 +02:00
enum_glob_use.rs rustup https://github.com/rust-lang/rust/pull/61836/ 2019-06-18 11:15:47 +02:00
enum_variants.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
eq_op.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
erasing_op.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
escape.rs Replace Arg with Param 2019-08-28 18:33:25 +09:00
eta_reduction.rs Replace Arg with Param 2019-08-28 18:33:25 +09:00
eval_order_dependence.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
excessive_precision.rs Update all the code to pass the updated use_self lint. 2019-07-31 08:50:43 +00:00
explicit_write.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
fallible_impl_from.rs Rename hir::map::local_def_id_from_hir_id to local_def_id 2019-07-06 10:52:51 +07:00
format.rs Re-add false positive check 2019-08-23 09:16:50 +00:00
formatting.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
functions.rs Fix too_many_lines false positive 2019-09-03 06:25:54 +02:00
get_last_with_len.rs Formatting inside if_chain! macro 2019-05-21 10:45:38 +02:00
identity_conversion.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
identity_op.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
if_not_else.rs Doctests: Enable running doc tests for pedantic lints 2019-08-03 20:36:38 +02:00
implicit_return.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
indexing_slicing.rs Rustup https://github.com/rust-lang/rust/pull/59369 2019-08-06 19:20:41 +07:00
infallible_destructuring_match.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
infinite_iter.rs Doctests: Enable running doc tests for pedantic lints 2019-08-03 20:36:38 +02:00
inherent_impl.rs Fix breakage due to rust-lang/rust#61968 2019-06-21 08:14:07 +02:00
inherent_to_string.rs Fix inherent_to_string false positive 2019-08-28 06:46:26 +09:00
inline_fn_without_body.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
int_plus_one.rs Update int_plus_one suggestion text 2019-08-28 07:29:30 +02:00
integer_division.rs Downgrade integer_division to restriction 2019-06-15 00:17:04 -07:00
items_after_statements.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
large_enum_variant.rs Rustup to rust-lang/rust#63543 2019-08-15 10:14:06 +02:00
len_zero.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
let_if_seq.rs Fix warnings about unnecessary lifetime bounds 2019-06-20 01:36:23 +07:00
lib.rs Add manual_saturating_arithmetic lint 2019-09-04 18:38:25 +09:00
lifetimes.rs Fix needless_lifetimes false positive 2019-09-01 08:11:40 +02:00
literal_representation.rs Update all the code to pass the updated use_self lint. 2019-07-31 08:50:43 +00:00
loops.rs fix misleading doc for explicit_counter_loop lint 2019-09-01 21:54:47 +02:00
main_recursion.rs Move expression check to LateLintPass 2019-08-05 13:23:30 +02:00
map_clone.rs Replace Arg with Param 2019-08-28 18:33:25 +09:00
map_unit_fn.rs Replace Arg with Param 2019-08-28 18:33:25 +09:00
matches.rs Fix match_as_ref bad suggestion 2019-08-25 07:10:45 +02:00
mem_discriminant.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
mem_forget.rs Doctests: Enable running doc tests for restriction lints 2019-08-03 21:24:50 +02:00
mem_replace.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
minmax.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
misc.rs Change float_cmp Applicability to HasPlaceholders 2019-08-28 07:23:23 +02:00
misc_early.rs Fix index out of bound in case of empty snippet 2019-09-02 20:38:40 +07:00
missing_const_for_fn.rs Fix missing_const_for_fn false positive 2019-08-29 08:07:41 +02:00
missing_doc.rs Rustup to https://github.com/rust-lang/rust/pull/63854 2019-08-25 08:06:32 +02:00
missing_inline.rs Rollup merge of #4331 - phansch:doctests_restriction, r=flip1995 2019-08-05 10:50:06 +02:00
multiple_crate_versions.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
mut_mut.rs Doctests: Enable running doc tests for pedantic lints 2019-08-03 20:36:38 +02:00
mut_reference.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
mutex_atomic.rs Doctests: Enable running doc tests for nursery lints 2019-08-03 21:01:23 +02:00
needless_bool.rs Add examples to some complexity lints 2019-08-22 15:41:07 +02:00
needless_borrow.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
needless_borrowed_ref.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
needless_continue.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
needless_pass_by_value.rs Replace Arg with Param 2019-08-28 18:33:25 +09:00
needless_update.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
neg_cmp_op_on_partial_ord.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
neg_multiply.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
new_without_default.rs Rename hir::map::local_def_id_from_hir_id to local_def_id 2019-07-06 10:52:51 +07:00
no_effect.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
non_copy_const.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
non_expressive_names.rs Rustup "Remove Spanned from {ast,hir}::FieldPat" 2019-08-16 09:32:27 +07:00
ok_if_let.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
open_options.rs Update formatting 2019-08-01 07:09:57 +02:00
overflow_check_conditional.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
panic_unimplemented.rs Use outer_expn_data instead of outer_expn_info 2019-08-16 09:31:12 -07:00
partialeq_ne_impl.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
path_buf_push_overwrite.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
precedence.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
ptr.rs Rename hir::map::local_def_id_from_hir_id to local_def_id 2019-07-06 10:52:51 +07:00
ptr_offset_with_cast.rs Update all the code to pass the updated use_self lint. 2019-07-31 08:50:43 +00:00
question_mark.rs rustup https://github.com/rust-lang/rust/pull/61995 2019-07-03 18:00:35 +02:00
ranges.rs Fix occurrences of too_many_lines violations 2019-09-03 06:26:49 +02:00
redundant_clone.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
redundant_field_names.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
redundant_pattern_matching.rs Fix suggestions for redundant_pattern_matching 2019-08-21 07:29:44 +02:00
redundant_static_lifetimes.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
reference.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
regex.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
replace_consts.rs Doctests: Enable running doc tests for pedantic lints 2019-08-03 20:36:38 +02:00
returns.rs Fix unused_unit false positive 2019-08-24 22:09:02 +02:00
serde_api.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
shadow.rs Rustup "Remove Spanned from {ast,hir}::FieldPat" 2019-08-16 09:32:27 +07:00
slow_vector_initialization.rs Doctests: Enable running doc tests for perf lints 2019-08-03 08:08:00 +02:00
strings.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
suspicious_trait_impl.rs get_parent_node_by_hir_id -> get_parent_node 2019-06-25 14:33:51 -07:00
swap.rs Add examples to some correctness lints 2019-08-22 15:41:07 +02:00
temporary_assignment.rs Rustup to rustc 1.36.0-nightly (13fde05b1 2019-05-03) 2019-05-03 22:28:34 -07:00
trait_bounds.rs Made lint pedantic 2019-08-17 11:45:05 +01:00
transmute.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00
transmuting_null.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
trivially_copy_pass_by_ref.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
try_err.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
types.rs Fix occurrences of too_many_lines violations 2019-09-03 06:26:49 +02:00
unicode.rs Update Unicode lint tests 2019-08-23 05:42:45 +00:00
unsafe_removed_from_name.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
unused_io_amount.rs Prevent symbocalypse 2019-05-17 23:53:54 +02:00
unused_label.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
unwrap.rs Remove in_macro_or_desugar 2019-08-19 09:30:32 -07:00
use_self.rs Update formatting 2019-08-01 07:09:57 +02:00
vec.rs Use outer_expn_data instead of outer_expn_info 2019-08-16 09:31:12 -07:00
wildcard_dependencies.rs Use lint pass macros 2019-04-17 09:35:22 -07:00
write.rs Fix occurrences of too_many_lines violations 2019-09-03 06:26:49 +02:00
zero_div_zero.rs Doctests: Fix all complexity lint docs 2019-08-02 18:16:35 +02:00