mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
add uitest for issue 12816
This commit is contained in:
parent
2c61b45576
commit
e18b27aa2a
2 changed files with 23 additions and 1 deletions
|
@ -53,3 +53,9 @@ fn main() {
|
|||
const N: usize = 1024;
|
||||
const _: () = assert!(N.is_power_of_two());
|
||||
}
|
||||
|
||||
#[allow(clippy::eq_op)]
|
||||
const _: () = {
|
||||
assert!(true);
|
||||
assert!(8 == (7 + 1));
|
||||
};
|
||||
|
|
|
@ -80,5 +80,21 @@ LL | const _: () = assert!(true);
|
|||
|
|
||||
= help: remove it
|
||||
|
||||
error: aborting due to 10 previous errors
|
||||
error: `assert!(true)` will be optimized out by the compiler
|
||||
--> tests/ui/assertions_on_constants.rs:59:5
|
||||
|
|
||||
LL | assert!(true);
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= help: remove it
|
||||
|
||||
error: `assert!(true)` will be optimized out by the compiler
|
||||
--> tests/ui/assertions_on_constants.rs:60:5
|
||||
|
|
||||
LL | assert!(8 == (7 + 1));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: remove it
|
||||
|
||||
error: aborting due to 12 previous errors
|
||||
|
||||
|
|
Loading…
Reference in a new issue