mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 00:47:16 +00:00
a0234b4e8b
- remove now dead code in ASSERTIONS_ON_CONSTANTS cc #11966 - Partially revert "ignore `assertions-on-constants` in const contexts" This reverts commit c7074de420a2192fb40d3f2194a20dd0d1b65cc6.
100 lines
2.7 KiB
Text
100 lines
2.7 KiB
Text
error: `assert!(true)` will be optimized out by the compiler
|
|
--> tests/ui/assertions_on_constants.rs:10:5
|
|
|
|
|
LL | assert!(true);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: remove it
|
|
= note: `-D clippy::assertions-on-constants` implied by `-D warnings`
|
|
= help: to override `-D warnings` add `#[allow(clippy::assertions_on_constants)]`
|
|
|
|
error: `assert!(false)` should probably be replaced
|
|
--> tests/ui/assertions_on_constants.rs:12:5
|
|
|
|
|
LL | assert!(false);
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
|
= help: use `panic!()` or `unreachable!()`
|
|
|
|
error: `assert!(true)` will be optimized out by the compiler
|
|
--> tests/ui/assertions_on_constants.rs:14:5
|
|
|
|
|
LL | assert!(true, "true message");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: remove it
|
|
|
|
error: `assert!(false, ..)` should probably be replaced
|
|
--> tests/ui/assertions_on_constants.rs:16:5
|
|
|
|
|
LL | assert!(false, "false message");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: use `panic!(..)` or `unreachable!(..)`
|
|
|
|
error: `assert!(false, ..)` should probably be replaced
|
|
--> tests/ui/assertions_on_constants.rs:20:5
|
|
|
|
|
LL | assert!(false, "{}", msg.to_uppercase());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: use `panic!(..)` or `unreachable!(..)`
|
|
|
|
error: `assert!(true)` will be optimized out by the compiler
|
|
--> tests/ui/assertions_on_constants.rs:24:5
|
|
|
|
|
LL | assert!(B);
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: remove it
|
|
|
|
error: `assert!(false)` should probably be replaced
|
|
--> tests/ui/assertions_on_constants.rs:28:5
|
|
|
|
|
LL | assert!(C);
|
|
| ^^^^^^^^^^
|
|
|
|
|
= help: use `panic!()` or `unreachable!()`
|
|
|
|
error: `assert!(false, ..)` should probably be replaced
|
|
--> tests/ui/assertions_on_constants.rs:30:5
|
|
|
|
|
LL | assert!(C, "C message");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: use `panic!(..)` or `unreachable!(..)`
|
|
|
|
error: `debug_assert!(true)` will be optimized out by the compiler
|
|
--> tests/ui/assertions_on_constants.rs:33:5
|
|
|
|
|
LL | debug_assert!(true);
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: remove it
|
|
|
|
error: `assert!(true)` will be optimized out by the compiler
|
|
--> tests/ui/assertions_on_constants.rs:49:19
|
|
|
|
|
LL | const _: () = assert!(true);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: remove it
|
|
|
|
error: `assert!(true)` will be optimized out by the compiler
|
|
--> tests/ui/assertions_on_constants.rs:52:5
|
|
|
|
|
LL | assert!(8 == (7 + 1));
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= help: remove it
|
|
|
|
error: `assert!(true)` will be optimized out by the compiler
|
|
--> tests/ui/assertions_on_constants.rs:61:5
|
|
|
|
|
LL | assert!(true);
|
|
| ^^^^^^^^^^^^^
|
|
|
|
|
= help: remove it
|
|
|
|
error: aborting due to 12 previous errors
|
|
|