File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1017,13 +1017,13 @@ extern "rust-intrinsic" {
1017
1017
/// unsafe {
1018
1018
/// // The call to offset is always safe because `Vec` will never
1019
1019
/// // allocate more than `isize::MAX` bytes.
1020
- /// let dst = dst.as_mut_ptr().offset(dst_len as isize);
1021
- /// let src = src.as_ptr();
1020
+ /// let dst_ptr = dst.as_mut_ptr().offset(dst_len as isize);
1021
+ /// let src_ptr = src.as_ptr();
1022
1022
///
1023
1023
/// // The two regions cannot overlap becuase mutable references do
1024
1024
/// // not alias, and two different vectors cannot own the same
1025
1025
/// // memory.
1026
- /// ptr::copy_nonoverlapping(src, dst , src_len);
1026
+ /// ptr::copy_nonoverlapping(src_ptr, dst_ptr , src_len);
1027
1027
///
1028
1028
/// // Truncate `src` without dropping its contents. This cannot panic,
1029
1029
/// // so double-drops cannot happen.
@@ -1145,7 +1145,7 @@ extern "rust-intrinsic" {
1145
1145
/// Creating an invalid value:
1146
1146
///
1147
1147
/// ```
1148
- /// use std::ptr;
1148
+ /// use std::{mem, ptr} ;
1149
1149
///
1150
1150
/// let mut v = Box::new(0i32);
1151
1151
///
You can’t perform that action at this time.
0 commit comments