Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fake libc in core test #123976

Merged
merged 1 commit into from
Apr 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions library/core/src/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,11 @@ impl () {}
/// ## 4. Get it from C.
///
/// ```
/// # #![feature(rustc_private)]
/// # mod libc {
/// # pub unsafe fn malloc(_size: usize) -> *mut core::ffi::c_void { core::ptr::NonNull::dangling().as_ptr() }
/// # pub unsafe fn free(_ptr: *mut core::ffi::c_void) {}
/// # }
/// # #[cfg(any())]
/// #[allow(unused_extern_crates)]
/// extern crate libc;
///
Expand All @@ -548,7 +552,7 @@ impl () {}
/// if my_num.is_null() {
/// panic!("failed to allocate memory");
/// }
/// libc::free(my_num as *mut libc::c_void);
/// libc::free(my_num as *mut core::ffi::c_void);
/// }
/// ```
///
Expand Down
Loading