summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/is_digit_ascii_radix.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/is_digit_ascii_radix.rs')
-rw-r--r--src/tools/clippy/tests/ui/is_digit_ascii_radix.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/is_digit_ascii_radix.rs b/src/tools/clippy/tests/ui/is_digit_ascii_radix.rs
new file mode 100644
index 000000000..68e3f3243
--- /dev/null
+++ b/src/tools/clippy/tests/ui/is_digit_ascii_radix.rs
@@ -0,0 +1,18 @@
+// run-rustfix
+
+#![warn(clippy::is_digit_ascii_radix)]
+
+const TEN: u32 = 10;
+
+fn main() {
+ let c: char = '6';
+
+ // Should trigger the lint.
+ let _ = c.is_digit(10);
+ let _ = c.is_digit(16);
+ let _ = c.is_digit(0x10);
+
+ // Should not trigger the lint.
+ let _ = c.is_digit(11);
+ let _ = c.is_digit(TEN);
+}