blob: 9d1245e2d02ad77ad69b1fa10c7bc35cb82e7a84 [file] [log] [blame]
//@no-rustfix
#![allow(clippy::len_without_is_empty)]
// Check that the lint expectation is fulfilled even if the lint is allowed at the type level.
pub struct Empty;
impl Empty {
#[expect(clippy::len_without_is_empty)]
pub fn len(&self) -> usize {
0
}
}
// Check that the lint expectation is not triggered if it should not
pub struct Empty2;
impl Empty2 {
#[expect(clippy::len_without_is_empty)] //~ ERROR: this lint expectation is unfulfilled
pub fn len(&self) -> usize {
0
}
pub fn is_empty(&self) -> bool {
false
}
}
fn main() {}