2021-01-03 21:34:11 +00:00
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2023-03-07 14:40:55 +00:00
|
|
|
--> $DIR/ptr_as_ptr.rs:14:13
|
2021-01-03 21:34:11 +00:00
|
|
|
|
|
|
|
|
LL | let _ = ptr as *const i32;
|
|
|
|
| ^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `ptr.cast::<i32>()`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::ptr-as-ptr` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2023-03-07 14:40:55 +00:00
|
|
|
--> $DIR/ptr_as_ptr.rs:15:13
|
2021-01-03 21:34:11 +00:00
|
|
|
|
|
|
|
|
LL | let _ = mut_ptr as *mut i32;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `mut_ptr.cast::<i32>()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2023-03-07 14:40:55 +00:00
|
|
|
--> $DIR/ptr_as_ptr.rs:20:17
|
2021-01-03 21:34:11 +00:00
|
|
|
|
|
|
|
|
LL | let _ = *ptr_ptr as *const i32;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `(*ptr_ptr).cast::<i32>()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2023-03-07 14:40:55 +00:00
|
|
|
--> $DIR/ptr_as_ptr.rs:33:25
|
2021-01-03 21:34:11 +00:00
|
|
|
|
|
|
|
|
LL | let _: *const i32 = ptr as *const _;
|
|
|
|
| ^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `ptr.cast()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2023-03-07 14:40:55 +00:00
|
|
|
--> $DIR/ptr_as_ptr.rs:34:23
|
2021-01-03 21:34:11 +00:00
|
|
|
|
|
|
|
|
LL | let _: *mut i32 = mut_ptr as _;
|
|
|
|
| ^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `mut_ptr.cast()`
|
|
|
|
|
2021-01-04 21:17:31 +00:00
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2023-03-07 14:40:55 +00:00
|
|
|
--> $DIR/ptr_as_ptr.rs:37:21
|
2022-02-17 00:08:53 +00:00
|
|
|
|
|
2023-03-07 14:40:55 +00:00
|
|
|
LL | let _ = inline!($ptr as *const i32);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `$ptr.cast::<i32>()`
|
2022-02-17 00:08:53 +00:00
|
|
|
|
|
2023-03-07 14:40:55 +00:00
|
|
|
= note: this error originates in the macro `__inline_mac_fn_main` (in Nightly builds, run with -Z macro-backtrace for more info)
|
2022-02-17 00:08:53 +00:00
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2023-03-07 14:40:55 +00:00
|
|
|
--> $DIR/ptr_as_ptr.rs:58:13
|
2021-01-04 21:17:31 +00:00
|
|
|
|
|
|
|
|
LL | let _ = ptr as *const i32;
|
|
|
|
| ^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `ptr.cast::<i32>()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2023-03-07 14:40:55 +00:00
|
|
|
--> $DIR/ptr_as_ptr.rs:59:13
|
2021-01-04 21:17:31 +00:00
|
|
|
|
|
|
|
|
LL | let _ = mut_ptr as *mut i32;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `mut_ptr.cast::<i32>()`
|
|
|
|
|
2022-02-17 00:08:53 +00:00
|
|
|
error: aborting due to 8 previous errors
|
2021-01-03 21:34:11 +00:00
|
|
|
|