summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/manual_bits.fixed
blob: 4f1b19b75b8a1014d388b2a7097b3e34d7dc8b8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// 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;
}