#![warn(clippy::manual_bits)] #![allow( clippy::no_effect, clippy::useless_conversion, path_statements, unused_must_use, clippy::unnecessary_operation, clippy::unnecessary_cast )] use std::mem::{size_of, size_of_val}; fn main() { size_of::() * 8; size_of::() * 8; size_of::() * 8; size_of::() * 8; size_of::() * 8; size_of::() * 8; size_of::() * 8; size_of::() * 8; size_of::() * 8; size_of::() * 8; size_of::() * 8; size_of::() * 8; 8 * size_of::(); 8 * size_of::(); 8 * size_of::(); 8 * size_of::(); 8 * size_of::(); 8 * size_of::(); 8 * size_of::(); 8 * size_of::(); 8 * size_of::(); 8 * size_of::(); 8 * size_of::(); 8 * size_of::(); size_of::() * 4; 4 * size_of::(); size_of::() * 8; 8 * size_of::(); size_of_val(&0u32) * 8; type Word = u32; size_of::() * 8; type Bool = bool; size_of::() * 8; let _: u32 = (size_of::() * 8) as u32; let _: u32 = (size_of::() * 8).try_into().unwrap(); let _ = (size_of::() * 8).pow(5); let _ = &(size_of::() * 8); } fn should_not_lint() { macro_rules! bits_via_macro { ($T: ty) => { size_of::<$T>() * 8; }; } bits_via_macro!(u8); bits_via_macro!(String); }