2021-01-15 03:56:44 -06:00
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:19: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
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:28: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
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:29: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
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:34: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
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:47: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
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:48: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
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:51: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
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:72: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
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:73: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-16 07:12:50 -06:00
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:80:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
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
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:84:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
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
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:89:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
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
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:93:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
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
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:98:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
LL | ptr::null() as *const u32
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null::<u32>()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:102:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
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
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:107:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
LL | ptr::null() as *const u32
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null::<u32>()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:111:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
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
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:118:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
LL | ptr::null_mut() as *mut _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null_mut()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:122:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
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
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:127:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
LL | ptr::null_mut() as *mut _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null_mut()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:131:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
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
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:136:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
LL | ptr::null() as *const _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:140:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
LL | std::ptr::null() as *const _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `std::ptr::null()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:145:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
LL | ptr::null() as *const _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:149:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
LL | core::ptr::null() as *const _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `core::ptr::null()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:156:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
LL | ptr::null_mut() as _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null_mut()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:160:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
LL | std::ptr::null_mut() as _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `std::ptr::null_mut()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:165:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
LL | ptr::null_mut() as _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null_mut()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:169:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
LL | core::ptr::null_mut() as _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `core::ptr::null_mut()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:174:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
LL | ptr::null() as _
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:178:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
LL | std::ptr::null() as _
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try call directly: `std::ptr::null()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:183:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
LL | ptr::null() as _
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: try call directly: `ptr::null()`
|
|
|
|
|
|
|
|
error: `as` casting between raw pointers without changing its mutability
|
2024-03-07 10:19:29 -06:00
|
|
|
--> tests/ui/ptr_as_ptr.rs:187:9
|
2023-12-16 07:12:50 -06:00
|
|
|
|
|
|
|
|
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
|
|
|
|