We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f76177c commit 1c0d485Copy full SHA for 1c0d485
src/libcore/ptr/mod.rs
@@ -252,7 +252,7 @@ pub(crate) struct FatPtr<T> {
252
///
253
/// // create a slice pointer when starting out with a pointer to the first element
254
/// let x = [5, 6, 7];
255
-/// let ptr = &x[0] as *const _;
+/// let ptr = x.as_ptr();
256
/// let slice = ptr::slice_from_raw_parts(ptr, 3);
257
/// assert_eq!(unsafe { &*slice }[2], 7);
258
/// ```
0 commit comments