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 8c4d94a commit af760e1Copy full SHA for af760e1
library/core/src/primitive_docs.rs
@@ -537,7 +537,11 @@ impl () {}
537
/// ## 4. Get it from C.
538
///
539
/// ```
540
-/// # #![feature(rustc_private)]
+/// # mod libc {
541
+/// # pub unsafe fn malloc(_size: usize) -> *mut u8 { core::ptr::NonNull::dangling().as_ptr() }
542
+/// # pub unsafe fn free(mem: *mut core::ffi::c_void) {}
543
+/// # }
544
+/// # #[cfg(any())]
545
/// #[allow(unused_extern_crates)]
546
/// extern crate libc;
547
@@ -548,7 +552,7 @@ impl () {}
548
552
/// if my_num.is_null() {
549
553
/// panic!("failed to allocate memory");
550
554
/// }
551
-/// libc::free(my_num as *mut libc::c_void);
555
+/// libc::free(my_num as *mut core::ffi::c_void);
556
557
558
0 commit comments