#![warn(clippy::zero_sized_map_values)] use std::collections::HashMap; const CONST_OK: Option> = None; const CONST_NOT_OK: Option> = None; static STATIC_OK: Option> = None; static STATIC_NOT_OK: Option> = None; type OkMap = HashMap; type NotOkMap = HashMap; enum TestEnum { Ok(HashMap), NotOk(HashMap), } struct Test { ok: HashMap, not_ok: HashMap, also_not_ok: Vec>, } trait TestTrait { type Output; fn produce_output() -> Self::Output; fn weird_map(&self, map: HashMap); } impl Test { fn ok(&self) -> HashMap { todo!() } fn not_ok(&self) -> HashMap { todo!() } } impl TestTrait for Test { type Output = HashMap; fn produce_output() -> Self::Output { todo!(); } fn weird_map(&self, map: HashMap) { todo!(); } } fn test(map: HashMap, key: &str) -> HashMap { todo!(); } fn test2(map: HashMap, key: &str) -> HashMap { todo!(); } fn main() { let _: HashMap = HashMap::new(); let _: HashMap = HashMap::new(); let _: HashMap<_, _> = std::iter::empty::<(String, ())>().collect(); }