]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/manual_bits.fixed
New upstream version 1.60.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / manual_bits.fixed
1 // run-rustfix
2
3 #![warn(clippy::manual_bits)]
4 #![allow(clippy::no_effect, path_statements, unused_must_use, clippy::unnecessary_operation)]
5
6 use std::mem::{size_of, size_of_val};
7
8 fn main() {
9 i8::BITS;
10 i16::BITS;
11 i32::BITS;
12 i64::BITS;
13 i128::BITS;
14 isize::BITS;
15
16 u8::BITS;
17 u16::BITS;
18 u32::BITS;
19 u64::BITS;
20 u128::BITS;
21 usize::BITS;
22
23 i8::BITS;
24 i16::BITS;
25 i32::BITS;
26 i64::BITS;
27 i128::BITS;
28 isize::BITS;
29
30 u8::BITS;
31 u16::BITS;
32 u32::BITS;
33 u64::BITS;
34 u128::BITS;
35 usize::BITS;
36
37 size_of::<usize>() * 4;
38 4 * size_of::<usize>();
39 size_of::<bool>() * 8;
40 8 * size_of::<bool>();
41
42 size_of_val(&0u32) * 8;
43
44 type Word = u32;
45 Word::BITS;
46 type Bool = bool;
47 size_of::<Bool>() * 8;
48 }