summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/len_zero_ranges.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/len_zero_ranges.fixed')
-rw-r--r--src/tools/clippy/tests/ui/len_zero_ranges.fixed17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/len_zero_ranges.fixed b/src/tools/clippy/tests/ui/len_zero_ranges.fixed
new file mode 100644
index 000000000..797817662
--- /dev/null
+++ b/src/tools/clippy/tests/ui/len_zero_ranges.fixed
@@ -0,0 +1,17 @@
+// run-rustfix
+
+#![warn(clippy::len_zero)]
+#![allow(unused)]
+
+// Now that `Range(Inclusive)::is_empty` is stable (1.47), we can always suggest this
+mod issue_3807 {
+ fn suggestion_is_fine_range() {
+ let _ = (0..42).is_empty();
+ }
+
+ fn suggestion_is_fine_range_inclusive() {
+ let _ = (0_u8..=42).is_empty();
+ }
+}
+
+fn main() {}