|
1 | | -error: `assert!(true)` will be optimized out by the compiler |
| 1 | +error: this assertion is always `true` |
2 | 2 | --> tests/ui/assertions_on_constants.rs:10:5 |
3 | 3 | | |
4 | 4 | LL | assert!(true); |
5 | 5 | | ^^^^^^^^^^^^^ |
6 | 6 | | |
7 | | - = help: remove it |
| 7 | + = help: remove the assertion |
8 | 8 | = note: `-D clippy::assertions-on-constants` implied by `-D warnings` |
9 | 9 | = help: to override `-D warnings` add `#[allow(clippy::assertions_on_constants)]` |
10 | 10 |
|
11 | | -error: `assert!(false)` should probably be replaced |
| 11 | +error: this assertion is always `false` |
12 | 12 | --> tests/ui/assertions_on_constants.rs:13:5 |
13 | 13 | | |
14 | 14 | LL | assert!(false); |
15 | 15 | | ^^^^^^^^^^^^^^ |
16 | 16 | | |
17 | | - = help: use `panic!()` or `unreachable!()` |
| 17 | + = help: replace this with `panic!()` or `unreachable!()` |
18 | 18 |
|
19 | | -error: `assert!(true)` will be optimized out by the compiler |
| 19 | +error: this assertion is always `true` |
20 | 20 | --> tests/ui/assertions_on_constants.rs:16:5 |
21 | 21 | | |
22 | 22 | LL | assert!(true, "true message"); |
23 | 23 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
24 | 24 | | |
25 | | - = help: remove it |
| 25 | + = help: remove the assertion |
26 | 26 |
|
27 | | -error: `assert!(false, ..)` should probably be replaced |
| 27 | +error: this assertion is always `false` |
28 | 28 | --> tests/ui/assertions_on_constants.rs:19:5 |
29 | 29 | | |
30 | 30 | LL | assert!(false, "false message"); |
31 | 31 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
32 | 32 | | |
33 | | - = help: use `panic!(..)` or `unreachable!(..)` |
| 33 | + = help: replace this with `panic!()` or `unreachable!()` |
34 | 34 |
|
35 | | -error: `assert!(false, ..)` should probably be replaced |
| 35 | +error: this assertion is always `false` |
36 | 36 | --> tests/ui/assertions_on_constants.rs:23:5 |
37 | 37 | | |
38 | 38 | LL | assert!(false, "{}", msg.to_uppercase()); |
39 | 39 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
40 | 40 | | |
41 | | - = help: use `panic!(..)` or `unreachable!(..)` |
| 41 | + = help: replace this with `panic!()` or `unreachable!()` |
42 | 42 |
|
43 | | -error: `assert!(true)` will be optimized out by the compiler |
| 43 | +error: this assertion has a constant value |
44 | 44 | --> tests/ui/assertions_on_constants.rs:27:5 |
45 | 45 | | |
46 | 46 | LL | assert!(B); |
47 | 47 | | ^^^^^^^^^^ |
48 | 48 | | |
49 | | - = help: remove it |
| 49 | + = help: consider moving this into a const block: `const { assert!(..) }` |
50 | 50 |
|
51 | | -error: `assert!(false)` should probably be replaced |
| 51 | +error: this assertion has a constant value |
52 | 52 | --> tests/ui/assertions_on_constants.rs:31:5 |
53 | 53 | | |
54 | 54 | LL | assert!(C); |
55 | 55 | | ^^^^^^^^^^ |
56 | 56 | | |
57 | | - = help: use `panic!()` or `unreachable!()` |
| 57 | + = help: consider moving this into a const block: `const { assert!(..) }` |
58 | 58 |
|
59 | | -error: `assert!(false, ..)` should probably be replaced |
| 59 | +error: this assertion has a constant value |
60 | 60 | --> tests/ui/assertions_on_constants.rs:34:5 |
61 | 61 | | |
62 | 62 | LL | assert!(C, "C message"); |
63 | 63 | | ^^^^^^^^^^^^^^^^^^^^^^^ |
64 | 64 | | |
65 | | - = help: use `panic!(..)` or `unreachable!(..)` |
| 65 | + = help: consider moving this into a const block: `const { assert!(..) }` |
66 | 66 |
|
67 | | -error: `debug_assert!(true)` will be optimized out by the compiler |
| 67 | +error: this assertion is always `true` |
68 | 68 | --> tests/ui/assertions_on_constants.rs:37:5 |
69 | 69 | | |
70 | 70 | LL | debug_assert!(true); |
71 | 71 | | ^^^^^^^^^^^^^^^^^^^ |
72 | 72 | | |
73 | | - = help: remove it |
| 73 | + = help: remove the assertion |
74 | 74 |
|
75 | | -error: `assert!(true)` will be optimized out by the compiler |
76 | | - --> tests/ui/assertions_on_constants.rs:54:19 |
| 75 | +error: this assertion is always `true` |
| 76 | + --> tests/ui/assertions_on_constants.rs:53:19 |
77 | 77 | | |
78 | 78 | LL | const _: () = assert!(true); |
79 | 79 | | ^^^^^^^^^^^^^ |
80 | 80 | | |
81 | | - = help: remove it |
| 81 | + = help: remove the assertion |
82 | 82 |
|
83 | | -error: `assert!(true)` will be optimized out by the compiler |
84 | | - --> tests/ui/assertions_on_constants.rs:57:5 |
| 83 | +error: this assertion is always `true` |
| 84 | + --> tests/ui/assertions_on_constants.rs:56:5 |
85 | 85 | | |
86 | 86 | LL | assert!(8 == (7 + 1)); |
87 | 87 | | ^^^^^^^^^^^^^^^^^^^^^ |
88 | 88 | | |
89 | | - = help: remove it |
| 89 | + = help: remove the assertion |
90 | 90 |
|
91 | | -error: `assert!(true)` will be optimized out by the compiler |
92 | | - --> tests/ui/assertions_on_constants.rs:66:5 |
| 91 | +error: this assertion is always `true` |
| 92 | + --> tests/ui/assertions_on_constants.rs:67:5 |
93 | 93 | | |
94 | 94 | LL | assert!(true); |
95 | 95 | | ^^^^^^^^^^^^^ |
96 | 96 | | |
97 | | - = help: remove it |
| 97 | + = help: remove the assertion |
98 | 98 |
|
99 | | -error: aborting due to 12 previous errors |
| 99 | +error: this assertion is always `true` |
| 100 | + --> tests/ui/assertions_on_constants.rs:70:5 |
| 101 | + | |
| 102 | +LL | assert!(8 == (7 + 1)); |
| 103 | + | ^^^^^^^^^^^^^^^^^^^^^ |
| 104 | + | |
| 105 | + = help: remove the assertion |
| 106 | + |
| 107 | +error: this assertion has a constant value |
| 108 | + --> tests/ui/assertions_on_constants.rs:78:5 |
| 109 | + | |
| 110 | +LL | assert!(C); |
| 111 | + | ^^^^^^^^^^ |
| 112 | + | |
| 113 | + = help: consider moving this to an anonymous constant: `const _: () = { assert!(..); }` |
| 114 | + |
| 115 | +error: this assertion has a constant value |
| 116 | + --> tests/ui/assertions_on_constants.rs:89:5 |
| 117 | + | |
| 118 | +LL | assert!(C); |
| 119 | + | ^^^^^^^^^^ |
| 120 | + | |
| 121 | + = help: consider moving this into a const block: `const { assert!(..) }` |
| 122 | + |
| 123 | +error: this assertion has a constant value |
| 124 | + --> tests/ui/assertions_on_constants.rs:95:5 |
| 125 | + | |
| 126 | +LL | assert!(C); |
| 127 | + | ^^^^^^^^^^ |
| 128 | + | |
| 129 | + = help: consider moving this to an anonymous constant: `const _: () = { assert!(..); }` |
| 130 | + |
| 131 | +error: aborting due to 16 previous errors |
100 | 132 |
|
0 commit comments