11mod  crosspointer_transmute; 
22mod  eager_transmute; 
33mod  missing_transmute_annotations; 
4- mod  transmute_float_to_int; 
54mod  transmute_int_to_bool; 
6- mod  transmute_int_to_char; 
7- mod  transmute_int_to_float; 
85mod  transmute_int_to_non_zero; 
96mod  transmute_null_to_fn; 
10- mod  transmute_num_to_bytes; 
117mod  transmute_ptr_to_ptr; 
128mod  transmute_ptr_to_ref; 
139mod  transmute_ref_to_ref; 
@@ -141,40 +137,6 @@ declare_clippy_lint! {
141137    "transmutes from a pointer to a reference type" 
142138} 
143139
144- declare_clippy_lint !  { 
145-     /// ### What it does 
146-      /// Checks for transmutes from an integer to a `char`. 
147-      /// 
148-      /// ### Why is this bad? 
149-      /// Not every integer is a Unicode scalar value. 
150-      /// 
151-      /// ### Known problems 
152-      /// - [`from_u32`] which this lint suggests using is slower than `transmute` 
153-      /// as it needs to validate the input. 
154-      /// If you are certain that the input is always a valid Unicode scalar value, 
155-      /// use [`from_u32_unchecked`] which is as fast as `transmute` 
156-      /// but has a semantically meaningful name. 
157-      /// - You might want to handle `None` returned from [`from_u32`] instead of calling `unwrap`. 
158-      /// 
159-      /// [`from_u32`]: https://doc.rust-lang.org/std/char/fn.from_u32.html 
160-      /// [`from_u32_unchecked`]: https://doc.rust-lang.org/std/char/fn.from_u32_unchecked.html 
161-      /// 
162-      /// ### Example 
163-      /// ```no_run 
164-      /// let x = 1_u32; 
165-      /// unsafe { 
166-      ///     let _: char = std::mem::transmute(x); // where x: u32 
167-      /// } 
168-      /// 
169-      /// // should be: 
170-      /// let _ = std::char::from_u32(x).unwrap(); 
171-      /// ``` 
172-      #[ clippy:: version = "pre 1.29.0" ] 
173-     pub  TRANSMUTE_INT_TO_CHAR , 
174-     complexity, 
175-     "transmutes from an integer to a `char`" 
176- } 
177- 
178140declare_clippy_lint !  { 
179141    /// ### What it does 
180142     /// Checks for transmutes from a `&[u8]` to a `&str`. 
@@ -232,29 +194,6 @@ declare_clippy_lint! {
232194    "transmutes from an integer to a `bool`" 
233195} 
234196
235- declare_clippy_lint !  { 
236-     /// ### What it does 
237-      /// Checks for transmutes from an integer to a float. 
238-      /// 
239-      /// ### Why is this bad? 
240-      /// Transmutes are dangerous and error-prone, whereas `from_bits` is intuitive 
241-      /// and safe. 
242-      /// 
243-      /// ### Example 
244-      /// ```no_run 
245-      /// unsafe { 
246-      ///     let _: f32 = std::mem::transmute(1_u32); // where x: u32 
247-      /// } 
248-      /// 
249-      /// // should be: 
250-      /// let _: f32 = f32::from_bits(1_u32); 
251-      /// ``` 
252-      #[ clippy:: version = "pre 1.29.0" ] 
253-     pub  TRANSMUTE_INT_TO_FLOAT , 
254-     complexity, 
255-     "transmutes from an integer to a float" 
256- } 
257- 
258197declare_clippy_lint !  { 
259198    /// ### What it does 
260199     /// Checks for transmutes from `T` to `NonZero<T>`, and suggests the `new_unchecked` 
@@ -280,52 +219,6 @@ declare_clippy_lint! {
280219    "transmutes from an integer to a non-zero wrapper" 
281220} 
282221
283- declare_clippy_lint !  { 
284-     /// ### What it does 
285-      /// Checks for transmutes from a float to an integer. 
286-      /// 
287-      /// ### Why is this bad? 
288-      /// Transmutes are dangerous and error-prone, whereas `to_bits` is intuitive 
289-      /// and safe. 
290-      /// 
291-      /// ### Example 
292-      /// ```no_run 
293-      /// unsafe { 
294-      ///     let _: u32 = std::mem::transmute(1f32); 
295-      /// } 
296-      /// 
297-      /// // should be: 
298-      /// let _: u32 = 1f32.to_bits(); 
299-      /// ``` 
300-      #[ clippy:: version = "1.41.0" ] 
301-     pub  TRANSMUTE_FLOAT_TO_INT , 
302-     complexity, 
303-     "transmutes from a float to an integer" 
304- } 
305- 
306- declare_clippy_lint !  { 
307-     /// ### What it does 
308-      /// Checks for transmutes from a number to an array of `u8` 
309-      /// 
310-      /// ### Why this is bad? 
311-      /// Transmutes are dangerous and error-prone, whereas `to_ne_bytes` 
312-      /// is intuitive and safe. 
313-      /// 
314-      /// ### Example 
315-      /// ```no_run 
316-      /// unsafe { 
317-      ///     let x: [u8; 8] = std::mem::transmute(1i64); 
318-      /// } 
319-      /// 
320-      /// // should be 
321-      /// let x: [u8; 8] = 0i64.to_ne_bytes(); 
322-      /// ``` 
323-      #[ clippy:: version = "1.58.0" ] 
324-     pub  TRANSMUTE_NUM_TO_BYTES , 
325-     complexity, 
326-     "transmutes from a number to an array of `u8`" 
327- } 
328- 
329222declare_clippy_lint !  { 
330223    /// ### What it does 
331224     /// Checks for transmutes from a pointer to a pointer, or 
@@ -581,13 +474,9 @@ impl_lint_pass!(Transmute => [
581474    TRANSMUTE_PTR_TO_PTR , 
582475    USELESS_TRANSMUTE , 
583476    WRONG_TRANSMUTE , 
584-     TRANSMUTE_INT_TO_CHAR , 
585477    TRANSMUTE_BYTES_TO_STR , 
586478    TRANSMUTE_INT_TO_BOOL , 
587-     TRANSMUTE_INT_TO_FLOAT , 
588479    TRANSMUTE_INT_TO_NON_ZERO , 
589-     TRANSMUTE_FLOAT_TO_INT , 
590-     TRANSMUTE_NUM_TO_BYTES , 
591480    UNSOUND_COLLECTION_TRANSMUTE , 
592481    TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTS , 
593482    TRANSMUTE_UNDEFINED_REPR , 
@@ -632,14 +521,10 @@ impl<'tcx> LateLintPass<'tcx> for Transmute {
632521                | transmute_null_to_fn:: check ( cx,  e,  arg,  to_ty) 
633522                | transmute_ptr_to_ref:: check ( cx,  e,  from_ty,  to_ty,  arg,  path,  self . msrv ) 
634523                | missing_transmute_annotations:: check ( cx,  path,  from_ty,  to_ty,  e. hir_id ) 
635-                 | transmute_int_to_char:: check ( cx,  e,  from_ty,  to_ty,  arg,  const_context) 
636524                | transmute_ref_to_ref:: check ( cx,  e,  from_ty,  to_ty,  arg,  const_context) 
637525                | transmute_ptr_to_ptr:: check ( cx,  e,  from_ty,  to_ty,  arg,  self . msrv ) 
638526                | transmute_int_to_bool:: check ( cx,  e,  from_ty,  to_ty,  arg) 
639-                 | transmute_int_to_float:: check ( cx,  e,  from_ty,  to_ty,  arg,  const_context,  self . msrv ) 
640527                | transmute_int_to_non_zero:: check ( cx,  e,  from_ty,  to_ty,  arg) 
641-                 | transmute_float_to_int:: check ( cx,  e,  from_ty,  to_ty,  arg,  const_context,  self . msrv ) 
642-                 | transmute_num_to_bytes:: check ( cx,  e,  from_ty,  to_ty,  arg,  const_context,  self . msrv ) 
643528                | ( unsound_collection_transmute:: check ( cx,  e,  from_ty,  to_ty) 
644529                    || transmute_undefined_repr:: check ( cx,  e,  from_ty,  to_ty) ) 
645530                | ( eager_transmute:: check ( cx,  e,  arg,  from_ty,  to_ty) ) ; 
0 commit comments