11error: transmute from a reference to a pointer
2- --> tests/ui/transmute.rs:33 :27
2+ --> tests/ui/transmute.rs:34 :27
33 |
44LL | let _: *const T = core::mem::transmute(t);
55 | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `t as *const T`
@@ -8,61 +8,49 @@ LL | let _: *const T = core::mem::transmute(t);
88 = help: to override `-D warnings` add `#[allow(clippy::useless_transmute)]`
99
1010error: transmute from a reference to a pointer
11- --> tests/ui/transmute.rs:36 :25
11+ --> tests/ui/transmute.rs:37 :25
1212 |
1313LL | let _: *mut T = core::mem::transmute(t);
1414 | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `t as *const T as *mut T`
1515
1616error: transmute from a reference to a pointer
17- --> tests/ui/transmute.rs:39 :27
17+ --> tests/ui/transmute.rs:40 :27
1818 |
1919LL | let _: *const U = core::mem::transmute(t);
2020 | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `t as *const T as *const U`
2121
2222error: transmute from a type (`std::vec::Vec<i32>`) to itself
23- --> tests/ui/transmute.rs:47 :27
23+ --> tests/ui/transmute.rs:48 :27
2424 |
2525LL | let _: Vec<i32> = core::mem::transmute(my_vec());
2626 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2727
2828error: transmute from a type (`std::vec::Vec<i32>`) to itself
29- --> tests/ui/transmute.rs:50 :27
29+ --> tests/ui/transmute.rs:51 :27
3030 |
3131LL | let _: Vec<i32> = core::mem::transmute(my_vec());
3232 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3333
3434error: transmute from a type (`std::vec::Vec<i32>`) to itself
35- --> tests/ui/transmute.rs:53 :27
35+ --> tests/ui/transmute.rs:54 :27
3636 |
3737LL | let _: Vec<i32> = std::mem::transmute(my_vec());
3838 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3939
4040error: transmute from a type (`std::vec::Vec<i32>`) to itself
41- --> tests/ui/transmute.rs:56 :27
41+ --> tests/ui/transmute.rs:57 :27
4242 |
4343LL | let _: Vec<i32> = std::mem::transmute(my_vec());
4444 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4545
4646error: transmute from a type (`std::vec::Vec<i32>`) to itself
47- --> tests/ui/transmute.rs:59 :27
47+ --> tests/ui/transmute.rs:60 :27
4848 |
4949LL | let _: Vec<i32> = my_transmute(my_vec());
5050 | ^^^^^^^^^^^^^^^^^^^^^^
5151
52- error: transmute from an integer to a pointer
53- --> tests/ui/transmute.rs:62:31
54- |
55- LL | let _: *const usize = std::mem::transmute(5_isize);
56- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `5_isize as *const usize`
57-
58- error: transmute from an integer to a pointer
59- --> tests/ui/transmute.rs:67:31
60- |
61- LL | let _: *const usize = std::mem::transmute(1 + 1usize);
62- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(1 + 1usize) as *const usize`
63-
6452error: transmute from a type (`*const Usize`) to the type that it points to (`Usize`)
65- --> tests/ui/transmute.rs:99 :24
53+ --> tests/ui/transmute.rs:98 :24
6654 |
6755LL | let _: Usize = core::mem::transmute(int_const_ptr);
6856 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -71,25 +59,25 @@ LL | let _: Usize = core::mem::transmute(int_const_ptr);
7159 = help: to override `-D warnings` add `#[allow(clippy::crosspointer_transmute)]`
7260
7361error: transmute from a type (`*mut Usize`) to the type that it points to (`Usize`)
74- --> tests/ui/transmute.rs:102 :24
62+ --> tests/ui/transmute.rs:101 :24
7563 |
7664LL | let _: Usize = core::mem::transmute(int_mut_ptr);
7765 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7866
7967error: transmute from a type (`Usize`) to a pointer to that type (`*const Usize`)
80- --> tests/ui/transmute.rs:105 :31
68+ --> tests/ui/transmute.rs:104 :31
8169 |
8270LL | let _: *const Usize = core::mem::transmute(my_int());
8371 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8472
8573error: transmute from a type (`Usize`) to a pointer to that type (`*mut Usize`)
86- --> tests/ui/transmute.rs:108 :29
74+ --> tests/ui/transmute.rs:107 :29
8775 |
8876LL | let _: *mut Usize = core::mem::transmute(my_int());
8977 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9078
9179error: transmute from a `u8` to a `bool`
92- --> tests/ui/transmute.rs:115 :28
80+ --> tests/ui/transmute.rs:114 :28
9381 |
9482LL | let _: bool = unsafe { std::mem::transmute(0_u8) };
9583 | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `0_u8 != 0`
@@ -98,7 +86,7 @@ LL | let _: bool = unsafe { std::mem::transmute(0_u8) };
9886 = help: to override `-D warnings` add `#[allow(clippy::transmute_int_to_bool)]`
9987
10088error: transmute from a `&[u8]` to a `&str`
101- --> tests/ui/transmute.rs:122 :28
89+ --> tests/ui/transmute.rs:121 :28
10290 |
10391LL | let _: &str = unsafe { std::mem::transmute(B) };
10492 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8(B).unwrap()`
@@ -107,16 +95,16 @@ LL | let _: &str = unsafe { std::mem::transmute(B) };
10795 = help: to override `-D warnings` add `#[allow(clippy::transmute_bytes_to_str)]`
10896
10997error: transmute from a `&mut [u8]` to a `&mut str`
110- --> tests/ui/transmute.rs:125 :32
98+ --> tests/ui/transmute.rs:124 :32
11199 |
112100LL | let _: &mut str = unsafe { std::mem::transmute(mb) };
113101 | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_mut(mb).unwrap()`
114102
115103error: transmute from a `&[u8]` to a `&str`
116- --> tests/ui/transmute.rs:128 :30
104+ --> tests/ui/transmute.rs:127 :30
117105 |
118106LL | const _: &str = unsafe { std::mem::transmute(B) };
119107 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `std::str::from_utf8_unchecked(B)`
120108
121- error: aborting due to 18 previous errors
109+ error: aborting due to 16 previous errors
122110
0 commit comments