]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/len_zero_ranges.rs
`assertions_on_result_states` fix suggestion when `assert!` not in a statement
[rust.git] / tests / ui / len_zero_ranges.rs
index be2e0f38fd164cbef647318ba40846f0b915acff..a0eb51cc9760c462372dddaaa31819db94541efe 100644 (file)
@@ -1,15 +1,17 @@
 // run-rustfix
 
-#![feature(range_is_empty)]
 #![warn(clippy::len_zero)]
 #![allow(unused)]
-#![allow(stable_features)] // TODO: https://github.com/rust-lang/rust-clippy/issues/5956
 
+// Now that `Range(Inclusive)::is_empty` is stable (1.47), we can always suggest this
 mod issue_3807 {
-    // With the feature enabled, `is_empty` should be suggested
-    fn suggestion_is_fine() {
+    fn suggestion_is_fine_range() {
         let _ = (0..42).len() == 0;
     }
+
+    fn suggestion_is_fine_range_inclusive() {
+        let _ = (0_u8..=42).len() == 0;
+    }
 }
 
 fn main() {}