@@ -2,135 +2,135 @@ error: pointer must be non-null
2
2
--> tests/ui/invalid_null_ptr_usage.rs:3:59
3
3
|
4
4
LL | let _slice: &[usize] = std::slice::from_raw_parts(std::ptr::null(), 0);
5
- | ^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
5
+ | ^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
6
6
|
7
7
= note: `#[deny(clippy::invalid_null_ptr_usage)]` on by default
8
8
9
9
error: pointer must be non-null
10
10
--> tests/ui/invalid_null_ptr_usage.rs:4:59
11
11
|
12
12
LL | let _slice: &[usize] = std::slice::from_raw_parts(std::ptr::null_mut(), 0);
13
- | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
13
+ | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
14
14
15
15
error: pointer must be non-null
16
16
--> tests/ui/invalid_null_ptr_usage.rs:6:63
17
17
|
18
18
LL | let _slice: &[usize] = std::slice::from_raw_parts_mut(std::ptr::null_mut(), 0);
19
- | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
19
+ | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
20
20
21
21
error: pointer must be non-null
22
22
--> tests/ui/invalid_null_ptr_usage.rs:8:33
23
23
|
24
24
LL | std::ptr::copy::<usize>(std::ptr::null(), std::ptr::NonNull::dangling().as_ptr(), 0);
25
- | ^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
25
+ | ^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
26
26
27
27
error: pointer must be non-null
28
28
--> tests/ui/invalid_null_ptr_usage.rs:9:73
29
29
|
30
30
LL | std::ptr::copy::<usize>(std::ptr::NonNull::dangling().as_ptr(), std::ptr::null_mut(), 0);
31
- | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
31
+ | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
32
32
33
33
error: pointer must be non-null
34
34
--> tests/ui/invalid_null_ptr_usage.rs:11:48
35
35
|
36
36
LL | std::ptr::copy_nonoverlapping::<usize>(std::ptr::null(), std::ptr::NonNull::dangling().as_ptr(), 0);
37
- | ^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
37
+ | ^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
38
38
39
39
error: pointer must be non-null
40
40
--> tests/ui/invalid_null_ptr_usage.rs:12:88
41
41
|
42
42
LL | std::ptr::copy_nonoverlapping::<usize>(std::ptr::NonNull::dangling().as_ptr(), std::ptr::null_mut(), 0);
43
- | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
43
+ | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
44
44
45
45
error: pointer must be non-null
46
46
--> tests/ui/invalid_null_ptr_usage.rs:17:36
47
47
|
48
48
LL | let _a: A = std::ptr::read(std::ptr::null());
49
- | ^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
49
+ | ^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
50
50
51
51
error: pointer must be non-null
52
52
--> tests/ui/invalid_null_ptr_usage.rs:18:36
53
53
|
54
54
LL | let _a: A = std::ptr::read(std::ptr::null_mut());
55
- | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
55
+ | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
56
56
57
57
error: pointer must be non-null
58
58
--> tests/ui/invalid_null_ptr_usage.rs:20:46
59
59
|
60
60
LL | let _a: A = std::ptr::read_unaligned(std::ptr::null());
61
- | ^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
61
+ | ^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
62
62
63
63
error: pointer must be non-null
64
64
--> tests/ui/invalid_null_ptr_usage.rs:21:46
65
65
|
66
66
LL | let _a: A = std::ptr::read_unaligned(std::ptr::null_mut());
67
- | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
67
+ | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
68
68
69
69
error: pointer must be non-null
70
70
--> tests/ui/invalid_null_ptr_usage.rs:23:45
71
71
|
72
72
LL | let _a: A = std::ptr::read_volatile(std::ptr::null());
73
- | ^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
73
+ | ^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
74
74
75
75
error: pointer must be non-null
76
76
--> tests/ui/invalid_null_ptr_usage.rs:24:45
77
77
|
78
78
LL | let _a: A = std::ptr::read_volatile(std::ptr::null_mut());
79
- | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
79
+ | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
80
80
81
81
error: pointer must be non-null
82
82
--> tests/ui/invalid_null_ptr_usage.rs:26:39
83
83
|
84
84
LL | let _a: A = std::ptr::replace(std::ptr::null_mut(), A);
85
- | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
85
+ | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
86
86
87
87
error: pointer must be non-null
88
88
--> tests/ui/invalid_null_ptr_usage.rs:30:29
89
89
|
90
90
LL | std::ptr::swap::<A>(std::ptr::null_mut(), &mut A);
91
- | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
91
+ | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
92
92
93
93
error: pointer must be non-null
94
94
--> tests/ui/invalid_null_ptr_usage.rs:31:37
95
95
|
96
96
LL | std::ptr::swap::<A>(&mut A, std::ptr::null_mut());
97
- | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
97
+ | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
98
98
99
99
error: pointer must be non-null
100
100
--> tests/ui/invalid_null_ptr_usage.rs:33:44
101
101
|
102
102
LL | std::ptr::swap_nonoverlapping::<A>(std::ptr::null_mut(), &mut A, 0);
103
- | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
103
+ | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
104
104
105
105
error: pointer must be non-null
106
106
--> tests/ui/invalid_null_ptr_usage.rs:34:52
107
107
|
108
108
LL | std::ptr::swap_nonoverlapping::<A>(&mut A, std::ptr::null_mut(), 0);
109
- | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
109
+ | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
110
110
111
111
error: pointer must be non-null
112
112
--> tests/ui/invalid_null_ptr_usage.rs:36:25
113
113
|
114
114
LL | std::ptr::write(std::ptr::null_mut(), A);
115
- | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
115
+ | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
116
116
117
117
error: pointer must be non-null
118
118
--> tests/ui/invalid_null_ptr_usage.rs:38:35
119
119
|
120
120
LL | std::ptr::write_unaligned(std::ptr::null_mut(), A);
121
- | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
121
+ | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
122
122
123
123
error: pointer must be non-null
124
124
--> tests/ui/invalid_null_ptr_usage.rs:40:34
125
125
|
126
126
LL | std::ptr::write_volatile(std::ptr::null_mut(), A);
127
- | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
127
+ | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
128
128
129
129
error: pointer must be non-null
130
130
--> tests/ui/invalid_null_ptr_usage.rs:42:40
131
131
|
132
132
LL | std::ptr::write_bytes::<usize>(std::ptr::null_mut(), 42, 0);
133
- | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core ::ptr::NonNull::dangling().as_ptr()`
133
+ | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `std ::ptr::NonNull::dangling().as_ptr()`
134
134
135
135
error: aborting due to 22 previous errors
136
136
0 commit comments