Closed
Description
Code like (0..42).len() == 0
will trigger len_zero
, but (0..42).is_empty()
does not compile now.
Clippy version: 0.0.212 (2019-02-19)
Rustc version: 1.34.0-nightly (2019-02-22)
|
4 | println!("{}", (0..42).is_empty());
| ^^^^^^^^ multiple `is_empty` found
|
= note: candidate #1 is defined in an impl for the type `std::ops::Range<_>`
note: candidate #2 is defined in the trait `std::iter::ExactSizeIterator`
= help: to disambiguate the method call, write `std::iter::ExactSizeIterator::is_empty(::std::ops::Range{start: 0, end: 42,})` instead
Activity
ghost commentedon Jul 5, 2019
This isn't a Clippy bug. See rust-lang/rust#48111.
ghost commentedon Jul 5, 2019
🤔 On the other hand, maybe it shouldn't be suggesting unstable methods...
Fix/ignore clippy warnings
range_is_empty
is not enabled #5656Auto merge of #5656 - ebroto:len_zero_ranges, r=matthiaskrgr
refactor(tcw3): address clippy lints
refactor(pal): address clippy lints
feat(tcw3): address clippy lints
refactor(pal): address clippy lints
Rollup merge of rust-lang#5656 - ebroto:len_zero_ranges, r=matthiaskrgr
Stabilize Range[Inclusive]::is_empty