File tree 2 files changed +23
-1
lines changed
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -53,3 +53,9 @@ fn main() {
53
53
const N : usize = 1024 ;
54
54
const _: ( ) = assert ! ( N . is_power_of_two( ) ) ;
55
55
}
56
+
57
+ #[ allow( clippy:: eq_op) ]
58
+ const _: ( ) = {
59
+ assert ! ( true ) ;
60
+ assert ! ( 8 == ( 7 + 1 ) ) ;
61
+ } ;
Original file line number Diff line number Diff line change @@ -80,5 +80,21 @@ LL | const _: () = assert!(true);
80
80
|
81
81
= help: remove it
82
82
83
- error: aborting due to 10 previous errors
83
+ error: `assert!(true)` will be optimized out by the compiler
84
+ --> tests/ui/assertions_on_constants.rs:59:5
85
+ |
86
+ LL | assert!(true);
87
+ | ^^^^^^^^^^^^^
88
+ |
89
+ = help: remove it
90
+
91
+ error: `assert!(true)` will be optimized out by the compiler
92
+ --> tests/ui/assertions_on_constants.rs:60:5
93
+ |
94
+ LL | assert!(8 == (7 + 1));
95
+ | ^^^^^^^^^^^^^^^^^^^^^
96
+ |
97
+ = help: remove it
98
+
99
+ error: aborting due to 12 previous errors
84
100
You can’t perform that action at this time.
0 commit comments