2021-01-15 03:56:44 -06:00
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ptr_as_ptr.rs:18:33
|
2021-01-15 03:56:44 -06:00
|
|
|
|
|
2023-08-11 07:05:13 -05:00
|
|
|
LL | *unsafe { Box::from_raw(Box::into_raw(Box::new(o)) as *mut super::issue_11278_a::T<String>) }
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `Box::into_raw(Box::new(o)).cast::<super::issue_11278_a::T<String>>()`
|
2021-01-15 03:56:44 -06:00
|
|
|
|
|
|
|
|
= note: `-D clippy::ptr-as-ptr` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::ptr_as_ptr)]`
|
2021-01-15 03:56:44 -06:00
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ptr_as_ptr.rs:27:13
|
2023-08-11 07:05:13 -05: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-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ptr_as_ptr.rs:28:13
|
2021-01-15 03:56:44 -06: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-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ptr_as_ptr.rs:33:17
|
2021-01-15 03:56:44 -06: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-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ptr_as_ptr.rs:46:25
|
2021-01-15 03:56:44 -06: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-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ptr_as_ptr.rs:47:23
|
2021-01-15 03:56:44 -06:00
|
|
|
|
|
|
|
|
LL | let _: *mut i32 = mut_ptr as _;
|
|
|
|
| ^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `mut_ptr.cast()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ptr_as_ptr.rs:50:21
|
2022-02-26 07:26:21 -06:00
|
|
|
|
|
2023-03-24 08:04:35 -05:00
|
|
|
LL | let _ = inline!($ptr as *const i32);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `$ptr.cast::<i32>()`
|
2022-02-26 07:26:21 -06:00
|
|
|
|
|
2023-03-24 08:04:35 -05: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-26 07:26:21 -06:00
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ptr_as_ptr.rs:71:13
|
2021-01-15 03:56:44 -06: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-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ptr_as_ptr.rs:72:13
|
2021-01-15 03:56:44 -06:00
|
|
|
|
|
|
|
|
LL | let _ = mut_ptr as *mut i32;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `mut_ptr.cast::<i32>()`
|
|
|
|
|
2023-12-02 19:25:38 -06:00
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:79:9
|
|
|
|
|
|
|
|
|
LL | ptr::null_mut() as *mut u32
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null_mut::<u32>()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:83:9
|
|
|
|
|
|
|
|
|
LL | std::ptr::null_mut() as *mut u32
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `std::ptr::null_mut::<u32>()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:88:9
|
|
|
|
|
|
|
|
|
LL | ptr::null_mut() as *mut u32
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null_mut::<u32>()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:92:9
|
|
|
|
|
|
|
|
|
LL | core::ptr::null_mut() as *mut u32
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `core::ptr::null_mut::<u32>()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:97:9
|
|
|
|
|
|
|
|
|
LL | ptr::null() as *const u32
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null::<u32>()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:101:9
|
|
|
|
|
|
|
|
|
LL | std::ptr::null() as *const u32
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `std::ptr::null::<u32>()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:106:9
|
|
|
|
|
|
|
|
|
LL | ptr::null() as *const u32
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null::<u32>()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:110:9
|
|
|
|
|
|
|
|
|
LL | core::ptr::null() as *const u32
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `core::ptr::null::<u32>()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:117:9
|
|
|
|
|
|
|
|
|
LL | ptr::null_mut() as *mut _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null_mut()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:121:9
|
|
|
|
|
|
|
|
|
LL | std::ptr::null_mut() as *mut _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `std::ptr::null_mut()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:126:9
|
|
|
|
|
|
|
|
|
LL | ptr::null_mut() as *mut _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null_mut()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:130:9
|
|
|
|
|
|
|
|
|
LL | core::ptr::null_mut() as *mut _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `core::ptr::null_mut()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:135:9
|
|
|
|
|
|
|
|
|
LL | ptr::null() as *const _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:139:9
|
|
|
|
|
|
|
|
|
LL | std::ptr::null() as *const _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `std::ptr::null()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:144:9
|
|
|
|
|
|
|
|
|
LL | ptr::null() as *const _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:148:9
|
|
|
|
|
|
|
|
|
LL | core::ptr::null() as *const _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `core::ptr::null()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:155:9
|
|
|
|
|
|
|
|
|
LL | ptr::null_mut() as _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null_mut()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:159:9
|
|
|
|
|
|
|
|
|
LL | std::ptr::null_mut() as _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `std::ptr::null_mut()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:164:9
|
|
|
|
|
|
|
|
|
LL | ptr::null_mut() as _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null_mut()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:168:9
|
|
|
|
|
|
|
|
|
LL | core::ptr::null_mut() as _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `core::ptr::null_mut()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:173:9
|
|
|
|
|
|
|
|
|
LL | ptr::null() as _
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:177:9
|
|
|
|
|
|
|
|
|
LL | std::ptr::null() as _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `std::ptr::null()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:182:9
|
|
|
|
|
|
|
|
|
LL | ptr::null() as _
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
|
|
|
--> $DIR/ptr_as_ptr.rs:186:9
|
|
|
|
|
|
|
|
|
LL | core::ptr::null() as _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `core::ptr::null()`
|
|
|
|
|
|
|
|
error: aborting due to 33 previous errors
|
2021-01-15 03:56:44 -06:00
|
|
|
|