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" {
10171017 /// unsafe {
10181018 /// // The call to offset is always safe because `Vec` will never
10191019 /// // 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();
10221022 ///
10231023 /// // The two regions cannot overlap becuase mutable references do
10241024 /// // not alias, and two different vectors cannot own the same
10251025 /// // memory.
1026- /// ptr::copy_nonoverlapping(src, dst , src_len);
1026+ /// ptr::copy_nonoverlapping(src_ptr, dst_ptr , src_len);
10271027 ///
10281028 /// // Truncate `src` without dropping its contents. This cannot panic,
10291029 /// // so double-drops cannot happen.
@@ -1145,7 +1145,7 @@ extern "rust-intrinsic" {
11451145 /// Creating an invalid value:
11461146 ///
11471147 /// ```
1148- /// use std::ptr;
1148+ /// use std::{mem, ptr} ;
11491149 ///
11501150 /// let mut v = Box::new(0i32);
11511151 ///
You can’t perform that action at this time.
0 commit comments