1
- use crate :: utils:: { get_item_name, higher , snippet_with_applicability, span_lint, span_lint_and_sugg, walk_ptrs_ty} ;
1
+ use crate :: utils:: { get_item_name, snippet_with_applicability, span_lint, span_lint_and_sugg, walk_ptrs_ty} ;
2
2
use rustc_ast:: ast:: LitKind ;
3
3
use rustc_data_structures:: fx:: FxHashSet ;
4
4
use rustc_errors:: Applicability ;
@@ -260,17 +260,6 @@ fn check_len(
260
260
261
261
/// Checks if this type has an `is_empty` method.
262
262
fn has_is_empty ( cx : & LateContext < ' _ > , expr : & Expr < ' _ > ) -> bool {
263
- /// Special case ranges until `range_is_empty` is stabilized. See issue 3807.
264
- fn should_skip_range ( cx : & LateContext < ' _ > , expr : & Expr < ' _ > ) -> bool {
265
- higher:: range ( cx, expr) . map_or ( false , |_| {
266
- !cx. tcx
267
- . features ( )
268
- . declared_lib_features
269
- . iter ( )
270
- . any ( |( name, _) | name. as_str ( ) == "range_is_empty" )
271
- } )
272
- }
273
-
274
263
/// Gets an `AssocItem` and return true if it matches `is_empty(self)`.
275
264
fn is_is_empty ( cx : & LateContext < ' _ > , item : & ty:: AssocItem ) -> bool {
276
265
if let ty:: AssocKind :: Fn = item. kind {
@@ -296,10 +285,6 @@ fn has_is_empty(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
296
285
} )
297
286
}
298
287
299
- if should_skip_range ( cx, expr) {
300
- return false ;
301
- }
302
-
303
288
let ty = & walk_ptrs_ty ( cx. typeck_results ( ) . expr_ty ( expr) ) ;
304
289
match ty. kind {
305
290
ty:: Dynamic ( ref tt, ..) => tt. principal ( ) . map_or ( false , |principal| {
0 commit comments