2023-06-02 18:14:16 +00:00
|
|
|
error: `as` casting between raw pointers while changing only its constness
|
2023-07-27 11:40:22 +00:00
|
|
|
--> $DIR/ptr_cast_constness.rs:10:41
|
2023-05-15 00:25:23 +00:00
|
|
|
|
|
2023-06-02 18:14:16 +00:00
|
|
|
LL | let _: &mut T = std::mem::transmute(p as *mut T);
|
|
|
|
| ^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `p.cast_mut()`
|
2023-05-15 00:25:23 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::ptr-cast-constness` implied by `-D warnings`
|
|
|
|
|
2023-06-02 18:14:16 +00:00
|
|
|
error: `as` casting between raw pointers while changing only its constness
|
2023-07-27 11:40:22 +00:00
|
|
|
--> $DIR/ptr_cast_constness.rs:11:19
|
2023-06-02 18:14:16 +00: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
|
2023-07-27 11:40:22 +00:00
|
|
|
--> $DIR/ptr_cast_constness.rs:26:17
|
2023-06-02 18:14:16 +00: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
|
2023-07-27 11:40:22 +00:00
|
|
|
--> $DIR/ptr_cast_constness.rs:29:13
|
2023-05-15 00:25:23 +00:00
|
|
|
|
|
2023-06-02 18:14:16 +00:00
|
|
|
LL | let _ = ptr as *mut u32;
|
2023-05-15 00:25:23 +00:00
|
|
|
| ^^^^^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `ptr.cast_mut()`
|
|
|
|
|
2023-06-02 18:14:16 +00:00
|
|
|
error: `as` casting between raw pointers while changing only its constness
|
2023-07-27 11:40:22 +00:00
|
|
|
--> $DIR/ptr_cast_constness.rs:30:13
|
2023-05-15 00:25:23 +00:00
|
|
|
|
|
2023-06-02 18:14:16 +00:00
|
|
|
LL | let _ = mut_ptr as *const u32;
|
2023-05-15 00:25:23 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast_const`, a safer alternative: `mut_ptr.cast_const()`
|
|
|
|
|
2023-06-02 18:14:16 +00:00
|
|
|
error: `as` casting between raw pointers while changing only its constness
|
2023-07-27 11:40:22 +00:00
|
|
|
--> $DIR/ptr_cast_constness.rs:59:13
|
2023-05-15 00:25:23 +00:00
|
|
|
|
|
2023-06-02 18:14:16 +00:00
|
|
|
LL | let _ = ptr as *mut u32;
|
2023-05-15 00:25:23 +00:00
|
|
|
| ^^^^^^^^^^^^^^^ help: try `pointer::cast_mut`, a safer alternative: `ptr.cast_mut()`
|
|
|
|
|
2023-06-02 18:14:16 +00:00
|
|
|
error: `as` casting between raw pointers while changing only its constness
|
2023-07-27 11:40:22 +00:00
|
|
|
--> $DIR/ptr_cast_constness.rs:60:13
|
2023-05-15 00:25:23 +00:00
|
|
|
|
|
2023-06-02 18:14:16 +00:00
|
|
|
LL | let _ = mut_ptr as *const u32;
|
2023-05-15 00:25:23 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast_const`, a safer alternative: `mut_ptr.cast_const()`
|
|
|
|
|
2023-06-02 18:14:16 +00:00
|
|
|
error: aborting due to 7 previous errors
|
2023-05-15 00:25:23 +00:00
|
|
|
|