rust/clippy_lints/src
Michael Recachinas d7ea6addf0 (#1955): Suggests x > y over x >= y + 1 for ints
This module handles the following cases:
- `... >= ... + 1` and `... >= 1 + ...`
- `... - 1 >= ...` and `-1 + ... >= ...`
- `... + 1 <= ...` and `... + 1 <= ...`
- `... <= ... - 1` and `... <= -1 + ...`

Note: this only goes 1 level deep (i.e., does not constant-fold) and
does not currently simplify expressions. Examples of these
cases include:
```rust
let x = 1;
y >= y + x; // won't catch this case or any permutation

x + 1 >= y + 2; // won't catch this case

x + 1 - 1 >= y - 1 + 1; // WILL catch this case when it likely shouldn't
```
2017-09-17 17:18:12 +01:00
..
utils Rustup 2017-09-13 15:34:04 +02:00
approx_const.rs Fix links in approx_const 2017-09-12 19:08:18 +03:00
arithmetic.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
array_indexing.rs Rustup 2017-09-13 15:34:04 +02:00
assign_ops.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
attrs.rs Rustup 2017-09-12 14:38:59 +02:00
bit_mask.rs Update for latest Rust 2017-09-09 01:23:08 -04:00
blacklisted_name.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
block_in_if_condition.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
booleans.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
bytecount.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
collapsible_if.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
consts.rs Rustup 2017-09-13 15:34:04 +02:00
copies.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
cyclomatic_complexity.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
deprecated_lints.rs
derive.rs Rustup 2017-09-13 15:34:04 +02:00
doc.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
double_parens.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
drop_forget_ref.rs Rustup 2017-09-12 14:38:59 +02:00
empty_enum.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
entry.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
enum_clike.rs Rustup 2017-09-13 15:34:04 +02:00
enum_glob_use.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
enum_variants.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
eq_op.rs Update for latest Rust 2017-09-09 01:23:08 -04:00
escape.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
eta_reduction.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
eval_order_dependence.rs Rustup 2017-09-12 14:38:59 +02:00
format.rs Rustup 2017-09-12 14:38:59 +02:00
formatting.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
functions.rs Rustup 2017-09-12 14:38:59 +02:00
identity_op.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
if_let_redundant_pattern_matching.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
if_not_else.rs
infinite_iter.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
int_plus_one.rs (#1955): Suggests x > y over x >= y + 1 for ints 2017-09-17 17:18:12 +01:00
is_unit_expr.rs Fix empty documentation in unit_expr 2017-09-12 19:08:25 +03:00
items_after_statements.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
large_enum_variant.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
len_zero.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
let_if_seq.rs Rustup 2017-09-12 14:38:59 +02:00
lib.rs Rustup 2017-09-13 15:34:04 +02:00
lifetimes.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
literal_digit_grouping.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
loops.rs Add ExprLoop to contains_continue_expr() 2017-09-14 22:26:59 +09:00
map_clone.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
matches.rs Rustup 2017-09-13 15:34:04 +02:00
mem_forget.rs Rustup 2017-09-12 14:38:59 +02:00
methods.rs Enhance CHARS_*_CMP lint 2017-09-16 14:50:07 +09:00
minmax.rs Rustup 2017-09-12 14:38:59 +02:00
misc_early.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
misc.rs Rustup 2017-09-13 15:34:04 +02:00
missing_doc.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
mut_mut.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
mut_reference.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
mutex_atomic.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
needless_bool.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
needless_borrow.rs Add suggestion to needless_borrow 2017-09-16 11:27:24 +09:00
needless_borrowed_ref.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
needless_continue.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
needless_pass_by_value.rs Rustup 2017-09-12 14:38:59 +02:00
needless_update.rs
neg_multiply.rs
new_without_default.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
no_effect.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
non_expressive_names.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
ok_if_let.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
open_options.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
overflow_check_conditional.rs some small doc improvements 2017-09-01 22:43:34 +02:00
panic.rs Rustup 2017-09-12 14:38:59 +02:00
partialeq_ne_impl.rs Update for latest Rust 2017-09-09 01:23:08 -04:00
precedence.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
print.rs Rustup 2017-09-12 14:38:59 +02:00
ptr.rs suggestion for ptr_arg 2017-09-10 19:32:24 +02:00
ranges.rs Rustup 2017-09-13 15:34:04 +02:00
reference.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
regex.rs Merge remote-tracking branch 'origin/master' into rustup 2017-09-13 15:41:09 +02:00
returns.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
serde_api.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
shadow.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
should_assert_eq.rs Update for latest Rust 2017-09-09 01:23:08 -04:00
strings.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
swap.rs Accessing Span internals is deprecated 2017-08-31 14:47:45 +02:00
temporary_assignment.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
transmute.rs Rustup 2017-09-12 14:38:59 +02:00
types.rs Rustup 2017-09-13 15:34:04 +02:00
unicode.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
unsafe_removed_from_name.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
unused_io_amount.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
unused_label.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
use_self.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00
vec.rs Rustup 2017-09-13 15:34:04 +02:00
zero_div_zero.rs Run nightly rustfmt 2017-09-05 12:39:27 +02:00