#![warn(clippy::default_instead_of_iter_empty)] #![allow(dead_code)] #![feature(lang_items)] #![no_std] use core::panic::PanicInfo; #[lang = "eh_personality"] extern "C" fn eh_personality() {} #[panic_handler] fn panic(info: &PanicInfo) -> ! { loop {} } #[derive(Default)] struct Iter { iter: core::iter::Empty, } fn main() { // Do lint. let _ = core::iter::empty::(); let _foo: core::iter::Empty = core::iter::empty(); // Do not lint. let _ = Iter::default(); }