//@run-rustfix #![warn(clippy::default_instead_of_iter_empty)] #![allow(dead_code)] use std::collections::HashMap; #[derive(Default)] struct Iter { iter: std::iter::Empty, } fn main() { // Do lint. let _ = std::iter::empty::(); let _ = std::iter::empty::>(); let _foo: std::iter::Empty = std::iter::empty(); // Do not lint. let _ = Vec::::default(); let _ = String::default(); let _ = Iter::default(); }