The only thing you can do is hide such "internal" characters so that they do not appear in the documentation. For instance:
#[macro_export]
macro_rules! custom_abort {
($($args:tt)*) => {
match format!($($args)*) {
msg => $crate::custom_abort__(&msg)
}
};
}
/// This is an implementation detail and *should not* be called directly!
#[doc(hidden)]
pub fn custom_abort__(msg: &str) -> ! {
use std::io::Write;
let _ = writeln!(std::io::stderr(), "{}", msg);
std::process::exit(1);
}
, - custom_abort__. , - , , .