Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,18 @@ To stabilize a feature, follow these steps:
- Link to the tracking issue by adding "Closes #XXXXX".

You can see an example of stabilizing a feature with [tracking issue #81656 with FCP](https://github.com/rust-lang/rust/issues/81656) and the associated [implementation PR #84642](https://github.com/rust-lang/rust/pull/84642).
extern "C" {
fn dprintf(fd: i32, s: *const u8, ...);
}

macro_rules! dbg_printf {
($s:expr) => {
unsafe { dprintf(2, "%s\0".as_ptr(), $s as *const u8); }
}
}

fn function_to_debug() {
let dbg_str = format!("debug: {}\n\0", "hello world");
dbg_printf!(dbg_str.as_bytes().as_ptr());
}