2020-10-18 11:42:09 +00:00
|
|
|
error: pointer must be non-null
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:3:59
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | let _slice: &[usize] = std::slice::from_raw_parts(std::ptr::null(), 0);
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
|
= note: `#[deny(clippy::invalid_null_ptr_usage)]` on by default
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:4:59
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | let _slice: &[usize] = std::slice::from_raw_parts(std::ptr::null_mut(), 0);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:6:63
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | let _slice: &[usize] = std::slice::from_raw_parts_mut(std::ptr::null_mut(), 0);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:8:33
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | std::ptr::copy::<usize>(std::ptr::null(), std::ptr::NonNull::dangling().as_ptr(), 0);
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:9:73
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | std::ptr::copy::<usize>(std::ptr::NonNull::dangling().as_ptr(), std::ptr::null_mut(), 0);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:11:48
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | std::ptr::copy_nonoverlapping::<usize>(std::ptr::null(), std::ptr::NonNull::dangling().as_ptr(), 0);
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:12:88
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | std::ptr::copy_nonoverlapping::<usize>(std::ptr::NonNull::dangling().as_ptr(), std::ptr::null_mut(), 0);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:17:36
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | let _a: A = std::ptr::read(std::ptr::null());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:18:36
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | let _a: A = std::ptr::read(std::ptr::null_mut());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:20:46
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | let _a: A = std::ptr::read_unaligned(std::ptr::null());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:21:46
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | let _a: A = std::ptr::read_unaligned(std::ptr::null_mut());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:23:45
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | let _a: A = std::ptr::read_volatile(std::ptr::null());
|
|
|
|
| ^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:24:45
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | let _a: A = std::ptr::read_volatile(std::ptr::null_mut());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:26:39
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | let _a: A = std::ptr::replace(std::ptr::null_mut(), A);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-09-24 19:17:52 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:30:29
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | std::ptr::swap::<A>(std::ptr::null_mut(), &mut A);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-09-24 19:17:52 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:31:37
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | std::ptr::swap::<A>(&mut A, std::ptr::null_mut());
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-09-24 19:17:52 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:33:44
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | std::ptr::swap_nonoverlapping::<A>(std::ptr::null_mut(), &mut A, 0);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-09-24 19:17:52 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:34:52
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | std::ptr::swap_nonoverlapping::<A>(&mut A, std::ptr::null_mut(), 0);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-09-24 19:17:52 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:36:25
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | std::ptr::write(std::ptr::null_mut(), A);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-09-24 19:17:52 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:38:35
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | std::ptr::write_unaligned(std::ptr::null_mut(), A);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-09-24 19:17:52 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:40:34
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | std::ptr::write_volatile(std::ptr::null_mut(), A);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
|
|
|
error: pointer must be non-null
|
2024-09-24 19:17:52 +00:00
|
|
|
--> tests/ui/invalid_null_ptr_usage.rs:42:40
|
2020-10-18 11:42:09 +00:00
|
|
|
|
|
|
|
|
LL | std::ptr::write_bytes::<usize>(std::ptr::null_mut(), 42, 0);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
|
|
|
|
|
2024-09-24 15:22:26 +00:00
|
|
|
error: aborting due to 22 previous errors
|
2020-10-18 11:42:09 +00:00
|
|
|
|