- Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thing
Description
Summary
In rust 1.81, the following code triggers the clippy::len_without_is_empty
lint. However in the current 1.82 beta, the lint no longer fires. I haven't found any changes that would account for this, and the documentation says this lint is still warn by default.
pub struct Empty; impl Empty { pub fn len(&self) -> usize { 0 } }
rust 1.81:
warning: struct `Empty` has a public `len` method, but no `is_empty` method --> src/lib.rs:9:5 | 9 | pub fn len(&self) -> usize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty = note: `#[warn(clippy::len_without_is_empty)]` on by default
rust 1.82:
(no lint output)
Reproducer
(See above)
Version
rustc 1.82.0-beta.6 (763ad520c 2024-10-12)
binary: rustc
commit-hash: 763ad520cc6b831ec98e20f8a8fe85b160ad859d
commit-date: 2024-10-12
host: x86_64-unknown-linux-gnu
release: 1.82.0-beta.6
LLVM version: 19.1.1
Additional Labels
No response
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thing