mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
48 lines
792 B
Rust
48 lines
792 B
Rust
// run-rustfix
|
|
|
|
#![warn(clippy::manual_bits)]
|
|
#![allow(clippy::no_effect, path_statements, unused_must_use, clippy::unnecessary_operation)]
|
|
|
|
use std::mem::{size_of, size_of_val};
|
|
|
|
fn main() {
|
|
i8::BITS;
|
|
i16::BITS;
|
|
i32::BITS;
|
|
i64::BITS;
|
|
i128::BITS;
|
|
isize::BITS;
|
|
|
|
u8::BITS;
|
|
u16::BITS;
|
|
u32::BITS;
|
|
u64::BITS;
|
|
u128::BITS;
|
|
usize::BITS;
|
|
|
|
i8::BITS;
|
|
i16::BITS;
|
|
i32::BITS;
|
|
i64::BITS;
|
|
i128::BITS;
|
|
isize::BITS;
|
|
|
|
u8::BITS;
|
|
u16::BITS;
|
|
u32::BITS;
|
|
u64::BITS;
|
|
u128::BITS;
|
|
usize::BITS;
|
|
|
|
size_of::<usize>() * 4;
|
|
4 * size_of::<usize>();
|
|
size_of::<bool>() * 8;
|
|
8 * size_of::<bool>();
|
|
|
|
size_of_val(&0u32) * 8;
|
|
|
|
type Word = u32;
|
|
Word::BITS;
|
|
type Bool = bool;
|
|
size_of::<Bool>() * 8;
|
|
}
|