rust ignore warning code example Example 1: ignore #[warn(dead_code)] #[allow(dead_code)] fn dead() {} Example 2: allow dead code rust #[allow(dead_code)]