File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -53,3 +53,9 @@ fn main() {
5353 const N : usize = 1024 ;
5454 const _: ( ) = assert ! ( N . is_power_of_two( ) ) ;
5555}
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);
8080 |
8181 = help: remove it
8282
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
84100
You can’t perform that action at this time.
0 commit comments