2023-07-02 07:35:19 -05:00
|
|
|
error: `as` casting between raw pointers while changing only its constness
|
2024-02-19 07:53:53 -06:00
|
|
|
--> tests/ui/ptr_cast_constness.rs:15:41
|
2023-06-02 04:41:57 -05:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _: &mut T = std::mem::transmute(p as *mut T);
|
|
|
|
| ^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `p.cast_mut()`
|
2023-06-02 04:41:57 -05:00
|
|
|
|
|
|
|
|
= note: `-D clippy::ptr-cast-constness` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::ptr_cast_constness)]`
|
2023-06-02 04:41:57 -05:00
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
error: `as` casting between raw pointers while changing only its constness
|
2024-02-19 07:53:53 -06:00
|
|
|
--> tests/ui/ptr_cast_constness.rs:16:19
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _ = &mut *(p as *mut T);
|
|
|
|
| ^^^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `p.cast_mut()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers while changing only its constness
|
2024-02-19 07:53:53 -06:00
|
|
|
--> tests/ui/ptr_cast_constness.rs:31:17
|
2023-07-02 07:35:19 -05:00
|
|
|
|
|
|
|
|
LL | let _ = *ptr_ptr as *mut u32;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `(*ptr_ptr).cast_mut()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers while changing only its constness
|
2024-02-19 07:53:53 -06:00
|
|
|
--> tests/ui/ptr_cast_constness.rs:34:13
|
2023-06-02 04:41:57 -05:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = ptr as *mut u32;
|
2023-06-02 04:41:57 -05:00
|
|
|
| ^^^^^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `ptr.cast_mut()`
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
error: `as` casting between raw pointers while changing only its constness
|
2024-02-19 07:53:53 -06:00
|
|
|
--> tests/ui/ptr_cast_constness.rs:35:13
|
2023-06-02 04:41:57 -05:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = mut_ptr as *const u32;
|
2023-06-02 04:41:57 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast_const`, a safer alternative: `mut_ptr.cast_const()`
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
error: `as` casting between raw pointers while changing only its constness
|
2024-02-19 07:53:53 -06:00
|
|
|
--> tests/ui/ptr_cast_constness.rs:64:13
|
2023-06-02 04:41:57 -05:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = ptr as *mut u32;
|
2023-06-02 04:41:57 -05:00
|
|
|
| ^^^^^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `ptr.cast_mut()`
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
error: `as` casting between raw pointers while changing only its constness
|
2024-02-19 07:53:53 -06:00
|
|
|
--> tests/ui/ptr_cast_constness.rs:65:13
|
2023-06-02 04:41:57 -05:00
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
LL | let _ = mut_ptr as *const u32;
|
2023-06-02 04:41:57 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast_const`, a safer alternative: `mut_ptr.cast_const()`
|
|
|
|
|
2023-07-02 07:35:19 -05:00
|
|
|
error: aborting due to 7 previous errors
|
2023-06-02 04:41:57 -05:00
|
|
|
|