@@ -85,70 +85,52 @@ LL | let _a: A = std::ptr::replace(std::ptr::null_mut(), A);
85
85
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
86
86
87
87
error: pointer must be non-null
88
- --> tests/ui/invalid_null_ptr_usage.rs:28:69
89
- |
90
- LL | let _slice: *const [usize] = std::ptr::slice_from_raw_parts(std::ptr::null(), 0);
91
- | ^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
92
-
93
- error: pointer must be non-null
94
- --> tests/ui/invalid_null_ptr_usage.rs:29:69
95
- |
96
- LL | let _slice: *const [usize] = std::ptr::slice_from_raw_parts(std::ptr::null_mut(), 0);
97
- | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
98
-
99
- error: pointer must be non-null
100
- --> tests/ui/invalid_null_ptr_usage.rs:31:73
101
- |
102
- LL | let _slice: *const [usize] = std::ptr::slice_from_raw_parts_mut(std::ptr::null_mut(), 0);
103
- | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
104
-
105
- error: pointer must be non-null
106
- --> tests/ui/invalid_null_ptr_usage.rs:33:29
88
+ --> tests/ui/invalid_null_ptr_usage.rs:30:29
107
89
|
108
90
LL | std::ptr::swap::<A>(std::ptr::null_mut(), &mut A);
109
91
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
110
92
111
93
error: pointer must be non-null
112
- --> tests/ui/invalid_null_ptr_usage.rs:34 :37
94
+ --> tests/ui/invalid_null_ptr_usage.rs:31 :37
113
95
|
114
96
LL | std::ptr::swap::<A>(&mut A, std::ptr::null_mut());
115
97
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
116
98
117
99
error: pointer must be non-null
118
- --> tests/ui/invalid_null_ptr_usage.rs:36 :44
100
+ --> tests/ui/invalid_null_ptr_usage.rs:33 :44
119
101
|
120
102
LL | std::ptr::swap_nonoverlapping::<A>(std::ptr::null_mut(), &mut A, 0);
121
103
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
122
104
123
105
error: pointer must be non-null
124
- --> tests/ui/invalid_null_ptr_usage.rs:37 :52
106
+ --> tests/ui/invalid_null_ptr_usage.rs:34 :52
125
107
|
126
108
LL | std::ptr::swap_nonoverlapping::<A>(&mut A, std::ptr::null_mut(), 0);
127
109
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
128
110
129
111
error: pointer must be non-null
130
- --> tests/ui/invalid_null_ptr_usage.rs:39 :25
112
+ --> tests/ui/invalid_null_ptr_usage.rs:36 :25
131
113
|
132
114
LL | std::ptr::write(std::ptr::null_mut(), A);
133
115
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
134
116
135
117
error: pointer must be non-null
136
- --> tests/ui/invalid_null_ptr_usage.rs:41 :35
118
+ --> tests/ui/invalid_null_ptr_usage.rs:38 :35
137
119
|
138
120
LL | std::ptr::write_unaligned(std::ptr::null_mut(), A);
139
121
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
140
122
141
123
error: pointer must be non-null
142
- --> tests/ui/invalid_null_ptr_usage.rs:43 :34
124
+ --> tests/ui/invalid_null_ptr_usage.rs:40 :34
143
125
|
144
126
LL | std::ptr::write_volatile(std::ptr::null_mut(), A);
145
127
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
146
128
147
129
error: pointer must be non-null
148
- --> tests/ui/invalid_null_ptr_usage.rs:45 :40
130
+ --> tests/ui/invalid_null_ptr_usage.rs:42 :40
149
131
|
150
132
LL | std::ptr::write_bytes::<usize>(std::ptr::null_mut(), 42, 0);
151
133
| ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
152
134
153
- error: aborting due to 25 previous errors
135
+ error: aborting due to 22 previous errors
154
136
0 commit comments