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} ;
22use rustc_ast:: ast:: LitKind ;
33use rustc_data_structures:: fx:: FxHashSet ;
44use rustc_errors:: Applicability ;
@@ -260,17 +260,6 @@ fn check_len(
260260
261261/// Checks if this type has an `is_empty` method.
262262fn 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 ( 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-
274263 /// Gets an `AssocItem` and return true if it matches `is_empty(self)`.
275264 fn is_is_empty ( cx : & LateContext < ' _ > , item : & ty:: AssocItem ) -> bool {
276265 if let ty:: AssocKind :: Fn = item. kind {
@@ -296,10 +285,6 @@ fn has_is_empty(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
296285 } )
297286 }
298287
299- if should_skip_range ( cx, expr) {
300- return false ;
301- }
302-
303288 let ty = & walk_ptrs_ty ( cx. typeck_results ( ) . expr_ty ( expr) ) ;
304289 match ty. kind {
305290 ty:: Dynamic ( ref tt, ..) => tt. principal ( ) . map_or ( false , |principal| {
0 commit comments