diff options
| author | CAD97 <cad97@cad97.com> | 2020-01-15 17:00:36 -0500 |
|---|---|---|
| committer | CAD97 <cad97@cad97.com> | 2020-01-15 17:00:36 -0500 |
| commit | 1c0d4851a6a686d09b03fab575fb0847d1e9f665 (patch) | |
| tree | b3b686a970ac6f1dbb4ba0f50c07126cc359e003 | |
| parent | f76177ce4376ea15b1b303da347e8f653679cf88 (diff) | |
| download | rust-1c0d4851a6a686d09b03fab575fb0847d1e9f665.tar.gz rust-1c0d4851a6a686d09b03fab575fb0847d1e9f665.zip | |
Fix incorrect slice->ptr conversion in slice_from_raw_parts docs
| -rw-r--r-- | src/libcore/ptr/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcore/ptr/mod.rs b/src/libcore/ptr/mod.rs index 80f865d79e4..29956ae1a36 100644 --- a/src/libcore/ptr/mod.rs +++ b/src/libcore/ptr/mod.rs @@ -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); /// ``` |
