31
31
/// Create an `RawArrayView<A, D>` from shape information and a raw pointer
32
32
/// to the elements.
33
33
///
34
- /// Unsafe because caller is responsible for ensuring all of the following:
34
+ /// # Safety
35
+ ///
36
+ /// The caller is responsible for ensuring all of the following:
35
37
///
36
38
/// * `ptr` must be non-null, and it must be safe to [`.offset()`] `ptr` by
37
39
/// zero.
@@ -77,10 +79,12 @@ where
77
79
78
80
/// Converts to a read-only view of the array.
79
81
///
80
- /// **Warning** from a safety standpoint, this is equivalent to
81
- /// dereferencing a raw pointer for every element in the array. You must
82
- /// ensure that all of the data is valid, ensure that the pointer is
83
- /// aligned, and choose the correct lifetime.
82
+ /// # Safety
83
+ ///
84
+ /// From a safety standpoint, this is equivalent to dereferencing a raw
85
+ /// pointer for every element in the array. You must ensure that all of the
86
+ /// data is valid, ensure that the pointer is aligned, and choose the
87
+ /// correct lifetime.
84
88
#[ inline]
85
89
pub unsafe fn deref_into_view < ' a > ( self ) -> ArrayView < ' a , A , D > {
86
90
debug_assert ! (
@@ -163,7 +167,9 @@ where
163
167
/// Create an `RawArrayViewMut<A, D>` from shape information and a raw
164
168
/// pointer to the elements.
165
169
///
166
- /// Unsafe because caller is responsible for ensuring all of the following:
170
+ /// # Safety
171
+ ///
172
+ /// The caller is responsible for ensuring all of the following:
167
173
///
168
174
/// * `ptr` must be non-null, and it must be safe to [`.offset()`] `ptr` by
169
175
/// zero.
@@ -215,10 +221,12 @@ where
215
221
216
222
/// Converts to a read-only view of the array.
217
223
///
218
- /// **Warning** from a safety standpoint, this is equivalent to
219
- /// dereferencing a raw pointer for every element in the array. You must
220
- /// ensure that all of the data is valid, ensure that the pointer is
221
- /// aligned, and choose the correct lifetime.
224
+ /// # Safety
225
+ ///
226
+ /// From a safety standpoint, this is equivalent to dereferencing a raw
227
+ /// pointer for every element in the array. You must ensure that all of the
228
+ /// data is valid, ensure that the pointer is aligned, and choose the
229
+ /// correct lifetime.
222
230
#[ inline]
223
231
pub unsafe fn deref_into_view < ' a > ( self ) -> ArrayView < ' a , A , D > {
224
232
debug_assert ! (
@@ -230,10 +238,12 @@ where
230
238
231
239
/// Converts to a mutable view of the array.
232
240
///
233
- /// **Warning** from a safety standpoint, this is equivalent to
234
- /// dereferencing a raw pointer for every element in the array. You must
235
- /// ensure that all of the data is valid, ensure that the pointer is
236
- /// aligned, and choose the correct lifetime.
241
+ /// # Safety
242
+ ///
243
+ /// From a safety standpoint, this is equivalent to dereferencing a raw
244
+ /// pointer for every element in the array. You must ensure that all of the
245
+ /// data is valid, ensure that the pointer is aligned, and choose the
246
+ /// correct lifetime.
237
247
#[ inline]
238
248
pub unsafe fn deref_into_view_mut < ' a > ( self ) -> ArrayViewMut < ' a , A , D > {
239
249
debug_assert ! (
0 commit comments