Skip to content

Commit

Permalink
Fix incorrect slice->ptr conversion in slice_from_raw_parts docs
Browse files Browse the repository at this point in the history
  • Loading branch information
CAD97 committed Jan 15, 2020
1 parent f76177c commit 1c0d485
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcore/ptr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ pub(crate) struct FatPtr<T> {
///
/// // create a slice pointer when starting out with a pointer to the first element
/// let x = [5, 6, 7];
/// let ptr = &x[0] as *const _;
/// let ptr = x.as_ptr();
/// let slice = ptr::slice_from_raw_parts(ptr, 3);
/// assert_eq!(unsafe { &*slice }[2], 7);
/// ```
Expand Down

0 comments on commit 1c0d485

Please sign in to comment.