#![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::::default(); let _ = std::iter::Empty::>::default(); let _foo: std::iter::Empty = std::iter::Empty::default(); // Do not lint. let _ = Vec::::default(); let _ = String::default(); let _ = Iter::default(); }