summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/bool_to_int_with_if.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/bool_to_int_with_if.fixed')
-rw-r--r--src/tools/clippy/tests/ui/bool_to_int_with_if.fixed22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/bool_to_int_with_if.fixed b/src/tools/clippy/tests/ui/bool_to_int_with_if.fixed
index 2c8339cdd..37d3e3286 100644
--- a/src/tools/clippy/tests/ui/bool_to_int_with_if.fixed
+++ b/src/tools/clippy/tests/ui/bool_to_int_with_if.fixed
@@ -1,5 +1,6 @@
// run-rustfix
+#![feature(let_chains)]
#![warn(clippy::bool_to_int_with_if)]
#![allow(unused, dead_code, clippy::unnecessary_operation, clippy::no_effect)]
@@ -76,6 +77,8 @@ fn main() {
123
};
+ pub const SHOULD_NOT_LINT: usize = if true { 1 } else { 0 };
+
some_fn(a);
}
@@ -89,3 +92,22 @@ fn side_effect() {}
fn cond(a: bool, b: bool) -> bool {
a || b
}
+
+enum Enum {
+ A,
+ B,
+}
+
+fn if_let(a: Enum, b: Enum) {
+ if let Enum::A = a {
+ 1
+ } else {
+ 0
+ };
+
+ if let Enum::A = a && let Enum::B = b {
+ 1
+ } else {
+ 0
+ };
+}