Skip to content

Commit e519bb3

Browse files
committed
overflow-check-conditional: make lint adhere to lint message convention
1 parent 9178363 commit e519bb3

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

clippy_lints/src/overflow_check_conditional.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ impl<'tcx> LateLintPass<'tcx> for OverflowCheckConditional {
4242
if let BinOpKind::Lt = op.node {
4343
if let BinOpKind::Add = op2.node {
4444
span_lint(cx, OVERFLOW_CHECK_CONDITIONAL, expr.span,
45-
"You are trying to use classic C overflow conditions that will fail in Rust.");
45+
"you are trying to use classic C overflow conditions that will fail in Rust");
4646
}
4747
}
4848
if let BinOpKind::Gt = op.node {
4949
if let BinOpKind::Sub = op2.node {
5050
span_lint(cx, OVERFLOW_CHECK_CONDITIONAL, expr.span,
51-
"You are trying to use classic C underflow conditions that will fail in Rust.");
51+
"you are trying to use classic C underflow conditions that will fail in Rust");
5252
}
5353
}
5454
}
@@ -67,13 +67,13 @@ impl<'tcx> LateLintPass<'tcx> for OverflowCheckConditional {
6767
if let BinOpKind::Gt = op.node {
6868
if let BinOpKind::Add = op2.node {
6969
span_lint(cx, OVERFLOW_CHECK_CONDITIONAL, expr.span,
70-
"You are trying to use classic C overflow conditions that will fail in Rust.");
70+
"you are trying to use classic C overflow conditions that will fail in Rust");
7171
}
7272
}
7373
if let BinOpKind::Lt = op.node {
7474
if let BinOpKind::Sub = op2.node {
7575
span_lint(cx, OVERFLOW_CHECK_CONDITIONAL, expr.span,
76-
"You are trying to use classic C underflow conditions that will fail in Rust.");
76+
"you are trying to use classic C underflow conditions that will fail in Rust");
7777
}
7878
}
7979
}

tests/ui/overflow_check_conditional.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
1-
error: You are trying to use classic C overflow conditions that will fail in Rust.
1+
error: you are trying to use classic C overflow conditions that will fail in Rust
22
--> $DIR/overflow_check_conditional.rs:8:8
33
|
44
LL | if a + b < a {}
55
| ^^^^^^^^^
66
|
77
= note: `-D clippy::overflow-check-conditional` implied by `-D warnings`
88

9-
error: You are trying to use classic C overflow conditions that will fail in Rust.
9+
error: you are trying to use classic C overflow conditions that will fail in Rust
1010
--> $DIR/overflow_check_conditional.rs:9:8
1111
|
1212
LL | if a > a + b {}
1313
| ^^^^^^^^^
1414

15-
error: You are trying to use classic C overflow conditions that will fail in Rust.
15+
error: you are trying to use classic C overflow conditions that will fail in Rust
1616
--> $DIR/overflow_check_conditional.rs:10:8
1717
|
1818
LL | if a + b < b {}
1919
| ^^^^^^^^^
2020

21-
error: You are trying to use classic C overflow conditions that will fail in Rust.
21+
error: you are trying to use classic C overflow conditions that will fail in Rust
2222
--> $DIR/overflow_check_conditional.rs:11:8
2323
|
2424
LL | if b > a + b {}
2525
| ^^^^^^^^^
2626

27-
error: You are trying to use classic C underflow conditions that will fail in Rust.
27+
error: you are trying to use classic C underflow conditions that will fail in Rust
2828
--> $DIR/overflow_check_conditional.rs:12:8
2929
|
3030
LL | if a - b > b {}
3131
| ^^^^^^^^^
3232

33-
error: You are trying to use classic C underflow conditions that will fail in Rust.
33+
error: you are trying to use classic C underflow conditions that will fail in Rust
3434
--> $DIR/overflow_check_conditional.rs:13:8
3535
|
3636
LL | if b < a - b {}
3737
| ^^^^^^^^^
3838

39-
error: You are trying to use classic C underflow conditions that will fail in Rust.
39+
error: you are trying to use classic C underflow conditions that will fail in Rust
4040
--> $DIR/overflow_check_conditional.rs:14:8
4141
|
4242
LL | if a - b > a {}
4343
| ^^^^^^^^^
4444

45-
error: You are trying to use classic C underflow conditions that will fail in Rust.
45+
error: you are trying to use classic C underflow conditions that will fail in Rust
4646
--> $DIR/overflow_check_conditional.rs:15:8
4747
|
4848
LL | if a < a - b {}

0 commit comments

Comments
 (0)