11error: `(A * B)` is never greater than `B` and has therefore no effect
2- --> $DIR/unnecessary_min.rs:8 :13
2+ --> $DIR/unnecessary_min.rs:7 :13
33 |
44LL | let _ = (A * B).min(B); // Both are constants
55 | ^^^^^^^^^^^^^^ help: try: `(A * B)`
@@ -8,103 +8,103 @@ LL | let _ = (A * B).min(B); // Both are constants
88 = help: to override `-D warnings` add `#[allow(clippy::unnecessary_min)]`
99
1010error: `B` is never greater than `C` and has therefore no effect
11- --> $DIR/unnecessary_min.rs:9 :13
11+ --> $DIR/unnecessary_min.rs:8 :13
1212 |
1313LL | let _ = C.min(B); // Both are constants
1414 | ^^^^^^^^ help: try: `B`
1515
1616error: `B` is never greater than `C` and has therefore no effect
17- --> $DIR/unnecessary_min.rs:10 :13
17+ --> $DIR/unnecessary_min.rs:9 :13
1818 |
1919LL | let _ = B.min(C); // Both are constants
2020 | ^^^^^^^^ help: try: `B`
2121
2222error: `(-6_i32)` is never greater than `9` and has therefore no effect
23- --> $DIR/unnecessary_min.rs:12 :13
23+ --> $DIR/unnecessary_min.rs:11 :13
2424 |
2525LL | let _ = (-6_i32).min(9); // Both are Literals
2626 | ^^^^^^^^^^^^^^^ help: try: `(-6_i32)`
2727
2828error: `6` is never greater than `9_u32` and has therefore no effect
29- --> $DIR/unnecessary_min.rs:13 :13
29+ --> $DIR/unnecessary_min.rs:12 :13
3030 |
3131LL | let _ = 9_u32.min(6); // Both are Literals
3232 | ^^^^^^^^^^^^ help: try: `6`
3333
3434error: `6` is never greater than `7_u8` and has therefore no effect
35- --> $DIR/unnecessary_min.rs:15 :13
35+ --> $DIR/unnecessary_min.rs:14 :13
3636 |
3737LL | let _ = 6.min(7_u8); // Both are Literals
3838 | ^^^^^^^^^^^ help: try: `6`
3939
4040error: `0` is never greater than `7_u8` and has therefore no effect
41- --> $DIR/unnecessary_min.rs:17 :13
41+ --> $DIR/unnecessary_min.rs:16 :13
4242 |
4343LL | let _ = 0.min(7_u8); // unsigned with zero
4444 | ^^^^^^^^^^^ help: try: `0`
4545
4646error: `0_u32` is never greater than `7` and has therefore no effect
47- --> $DIR/unnecessary_min.rs:18 :13
47+ --> $DIR/unnecessary_min.rs:17 :13
4848 |
4949LL | let _ = 7.min(0_u32); // unsigned with zero
5050 | ^^^^^^^^^^^^ help: try: `0_u32`
5151
5252error: `i32::MIN` is never greater than `42` and has therefore no effect
53- --> $DIR/unnecessary_min.rs:20 :13
53+ --> $DIR/unnecessary_min.rs:19 :13
5454 |
5555LL | let _ = i32::MIN.min(42); // singed MIN
5656 | ^^^^^^^^^^^^^^^^ help: try: `i32::MIN`
5757
5858error: `i32::MIN` is never greater than `42` and has therefore no effect
59- --> $DIR/unnecessary_min.rs:21 :13
59+ --> $DIR/unnecessary_min.rs:20 :13
6060 |
6161LL | let _ = 42.min(i32::MIN); // singed MIN
6262 | ^^^^^^^^^^^^^^^^ help: try: `i32::MIN`
6363
6464error: `42` is never greater than `i32::MAX` and has therefore no effect
65- --> $DIR/unnecessary_min.rs:23 :13
65+ --> $DIR/unnecessary_min.rs:22 :13
6666 |
6767LL | let _ = i32::MAX.min(42); // singed MAX
6868 | ^^^^^^^^^^^^^^^^ help: try: `42`
6969
7070error: `42` is never greater than `i32::MAX` and has therefore no effect
71- --> $DIR/unnecessary_min.rs:24 :13
71+ --> $DIR/unnecessary_min.rs:23 :13
7272 |
7373LL | let _ = 42.min(i32::MAX); // singed MAX
7474 | ^^^^^^^^^^^^^^^^ help: try: `42`
7575
7676error: `0` is never greater than `test_usize()` and has therefore no effect
77- --> $DIR/unnecessary_min.rs:26 :13
77+ --> $DIR/unnecessary_min.rs:25 :13
7878 |
7979LL | let _ = 0.min(test_usize()); // unsigned with zero and function
8080 | ^^^^^^^^^^^^^^^^^^^ help: try: `0`
8181
8282error: `0` is never greater than `test_usize()` and has therefore no effect
83- --> $DIR/unnecessary_min.rs:28 :13
83+ --> $DIR/unnecessary_min.rs:27 :13
8484 |
8585LL | let _ = test_usize().min(0); // unsigned with zero and function
8686 | ^^^^^^^^^^^^^^^^^^^ help: try: `0`
8787
8888error: `i64::MIN` is never greater than `test_i64()` and has therefore no effect
89- --> $DIR/unnecessary_min.rs:30 :13
89+ --> $DIR/unnecessary_min.rs:29 :13
9090 |
9191LL | let _ = i64::MIN.min(test_i64()); // signed with MIN and function
9292 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `i64::MIN`
9393
9494error: `i64::MIN` is never greater than `test_i64()` and has therefore no effect
95- --> $DIR/unnecessary_min.rs:32 :13
95+ --> $DIR/unnecessary_min.rs:31 :13
9696 |
9797LL | let _ = test_i64().min(i64::MIN); // signed with MIN and function
9898 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `i64::MIN`
9999
100100error: `test_i64()` is never greater than `i64::MAX` and has therefore no effect
101- --> $DIR/unnecessary_min.rs:34 :13
101+ --> $DIR/unnecessary_min.rs:33 :13
102102 |
103103LL | let _ = i64::MAX.min(test_i64()); // signed with MAX and function
104104 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `test_i64()`
105105
106106error: `test_i64()` is never greater than `i64::MAX` and has therefore no effect
107- --> $DIR/unnecessary_min.rs:35 :13
107+ --> $DIR/unnecessary_min.rs:34 :13
108108 |
109109LL | let _ = test_i64().min(i64::MAX); // signed with MAX and function
110110 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `test_i64()`
0 commit comments