@@ -85,70 +85,52 @@ LL | let _a: A = std::ptr::replace(std::ptr::null_mut(), A);
8585 | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
8686
8787error: 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
10789 |
10890LL | std::ptr::swap::<A>(std::ptr::null_mut(), &mut A);
10991 | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
11092
11193error: 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
11395 |
11496LL | std::ptr::swap::<A>(&mut A, std::ptr::null_mut());
11597 | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
11698
11799error: 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
119101 |
120102LL | std::ptr::swap_nonoverlapping::<A>(std::ptr::null_mut(), &mut A, 0);
121103 | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
122104
123105error: 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
125107 |
126108LL | std::ptr::swap_nonoverlapping::<A>(&mut A, std::ptr::null_mut(), 0);
127109 | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
128110
129111error: 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
131113 |
132114LL | std::ptr::write(std::ptr::null_mut(), A);
133115 | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
134116
135117error: 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
137119 |
138120LL | std::ptr::write_unaligned(std::ptr::null_mut(), A);
139121 | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
140122
141123error: 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
143125 |
144126LL | std::ptr::write_volatile(std::ptr::null_mut(), A);
145127 | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
146128
147129error: 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
149131 |
150132LL | std::ptr::write_bytes::<usize>(std::ptr::null_mut(), 42, 0);
151133 | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `core::ptr::NonNull::dangling().as_ptr()`
152134
153- error: aborting due to 25 previous errors
135+ error: aborting due to 22 previous errors
154136
0 commit comments