about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/transmute_int_to_non_zero.stderr
blob: 995ab11a5bc9608a396be3725be8716cd629b6e3 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
error: transmute from a `u8` to a `NonZero<u8>`
  --> tests/ui/transmute_int_to_non_zero.rs:19:35
   |
LL |     let _: NonZero<u8> = unsafe { std::mem::transmute(int_u8) };
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_u8)`
   |
   = note: `-D clippy::transmute-int-to-non-zero` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::transmute_int_to_non_zero)]`

error: transmute from a `u16` to a `NonZero<u16>`
  --> tests/ui/transmute_int_to_non_zero.rs:22:36
   |
LL |     let _: NonZero<u16> = unsafe { std::mem::transmute(int_u16) };
   |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_u16)`

error: transmute from a `u32` to a `NonZero<u32>`
  --> tests/ui/transmute_int_to_non_zero.rs:25:36
   |
LL |     let _: NonZero<u32> = unsafe { std::mem::transmute(int_u32) };
   |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_u32)`

error: transmute from a `u64` to a `NonZero<u64>`
  --> tests/ui/transmute_int_to_non_zero.rs:28:36
   |
LL |     let _: NonZero<u64> = unsafe { std::mem::transmute(int_u64) };
   |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_u64)`

error: transmute from a `u128` to a `NonZero<u128>`
  --> tests/ui/transmute_int_to_non_zero.rs:31:37
   |
LL |     let _: NonZero<u128> = unsafe { std::mem::transmute(int_u128) };
   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_u128)`

error: transmute from a `i8` to a `NonZero<i8>`
  --> tests/ui/transmute_int_to_non_zero.rs:34:35
   |
LL |     let _: NonZero<i8> = unsafe { std::mem::transmute(int_i8) };
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_i8)`

error: transmute from a `i16` to a `NonZero<i16>`
  --> tests/ui/transmute_int_to_non_zero.rs:37:36
   |
LL |     let _: NonZero<i16> = unsafe { std::mem::transmute(int_i16) };
   |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_i16)`

error: transmute from a `i32` to a `NonZero<i32>`
  --> tests/ui/transmute_int_to_non_zero.rs:40:36
   |
LL |     let _: NonZero<i32> = unsafe { std::mem::transmute(int_i32) };
   |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_i32)`

error: transmute from a `i64` to a `NonZero<i64>`
  --> tests/ui/transmute_int_to_non_zero.rs:43:36
   |
LL |     let _: NonZero<i64> = unsafe { std::mem::transmute(int_i64) };
   |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_i64)`

error: transmute from a `i128` to a `NonZero<i128>`
  --> tests/ui/transmute_int_to_non_zero.rs:46:37
   |
LL |     let _: NonZero<i128> = unsafe { std::mem::transmute(int_i128) };
   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `NonZero::new_unchecked(int_i128)`

error: aborting due to 10 previous errors