@@ -54,11 +54,6 @@ pub use intrinsics::write_bytes;
54
54
///
55
55
/// # Safety
56
56
///
57
- /// `drop_in_place` is unsafe because it dereferences a raw pointer. The caller
58
- /// must ensure that the pointer points to a valid value of type `T`.
59
- ///
60
- /// # Undefined Behavior
61
- ///
62
57
/// Behavior is undefined if any of the following conditions are violated:
63
58
///
64
59
/// * `to_drop` must point to valid memory.
@@ -153,11 +148,6 @@ pub const fn null_mut<T>() -> *mut T { 0 as *mut T }
153
148
///
154
149
/// # Safety
155
150
///
156
- /// `swap` is unsafe because it dereferences a raw pointer. The caller must
157
- /// ensure that both pointers point to valid values of type `T`.
158
- ///
159
- /// # Undefined Behavior
160
- ///
161
151
/// Behavior is undefined if any of the following conditions are violated:
162
152
///
163
153
/// * `x` and `y` must point to valid, initialized memory.
@@ -307,14 +297,9 @@ unsafe fn swap_nonoverlapping_bytes(x: *mut u8, y: *mut u8, len: usize) {
307
297
/// operates on raw pointers instead of references. When references are
308
298
/// available, [`mem::replace`] should be preferred.
309
299
///
310
- /// # Safety
311
- ///
312
- /// `replace` is unsafe because it dereferences a raw pointer. The caller
313
- /// must ensure that the pointer points to a valid value of type `T`.
314
- ///
315
300
/// [`mem::replace`]: ../mem/fn.replace.html
316
301
///
317
- /// # Undefined Behavior
302
+ /// # Safety
318
303
///
319
304
/// Behavior is undefined if any of the following conditions are violated:
320
305
///
@@ -350,11 +335,6 @@ pub unsafe fn replace<T>(dest: *mut T, mut src: T) -> T {
350
335
///
351
336
/// # Safety
352
337
///
353
- /// `read` is unsafe because it dereferences a raw pointer. The caller
354
- /// must ensure that the pointer points to a valid value of type `T`.
355
- ///
356
- /// # Undefined Behavior
357
- ///
358
338
/// Behavior is undefined if any of the following conditions are violated:
359
339
///
360
340
/// * `src` must point to valid, initialized memory.
@@ -440,11 +420,6 @@ pub unsafe fn read<T>(src: *const T) -> T {
440
420
///
441
421
/// # Safety
442
422
///
443
- /// `read_unaligned` is unsafe because it dereferences a raw pointer. The caller
444
- /// must ensure that the pointer points to a valid value of type `T`.
445
- ///
446
- /// # Undefined Behavior
447
- ///
448
423
/// Behavior is undefined if any of the following conditions are violated:
449
424
///
450
425
/// * `src` must point to valid, initialized memory.
@@ -523,10 +498,6 @@ pub unsafe fn read_unaligned<T>(src: *const T) -> T {
523
498
///
524
499
/// # Safety
525
500
///
526
- /// `write` is unsafe because it dereferences a raw pointer.
527
- ///
528
- /// # Undefined Behavior
529
- ///
530
501
/// Behavior is undefined if any of the following conditions are violated:
531
502
///
532
503
/// * `dst` must point to valid memory.
@@ -600,10 +571,6 @@ pub unsafe fn write<T>(dst: *mut T, src: T) {
600
571
///
601
572
/// # Safety
602
573
///
603
- /// `write_unaligned` is unsafe because it dereferences a raw pointer.
604
- ///
605
- /// # Undefined Behavior
606
- ///
607
574
/// Behavior is undefined if any of the following conditions are violated:
608
575
///
609
576
/// * `dst` must point to valid memory.
@@ -671,11 +638,6 @@ pub unsafe fn write_unaligned<T>(dst: *mut T, src: T) {
671
638
///
672
639
/// # Safety
673
640
///
674
- /// `read_volatile` is unsafe because it dereferences a raw pointer. The caller
675
- /// must ensure that the pointer points to a valid value of type `T`.
676
- ///
677
- /// # Undefined Behavior
678
- ///
679
641
/// Behavior is undefined if any of the following conditions are violated:
680
642
///
681
643
/// * `src` must point to valid, initialized memory.
@@ -741,10 +703,6 @@ pub unsafe fn read_volatile<T>(src: *const T) -> T {
741
703
///
742
704
/// # Safety
743
705
///
744
- /// `write_volatile` is unsafe because it dereferences a raw pointer.
745
- ///
746
- /// # Undefined Behavior
747
- ///
748
706
/// Behavior is undefined if any of the following conditions are violated:
749
707
///
750
708
/// * `dst` must point to valid memory.
0 commit comments