Skip to content
Open
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
16 changes: 12 additions & 4 deletions rust_format/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@ const RUST_FMT_KEY: &str = "RUSTFMT";
#[cfg_attr(docsrs, doc(cfg(feature = "post_process")))]
#[macro_export]
macro_rules! _blank_ {
() => {};
($lit:literal) => {};
() => {
::core::compile_error!("The _blank_ macro is not meant to be invoked in code")
};
($lit:literal) => {
$crate::_blank_! {}
};
}

/// A "marker" macro used to mark locations in the source code where comments should be inserted.
Expand All @@ -98,8 +102,12 @@ macro_rules! _blank_ {
#[cfg_attr(docsrs, doc(cfg(feature = "post_process")))]
#[macro_export]
macro_rules! _comment_ {
() => {};
($lit:literal) => {};
() => {
::core::compile_error!("The _comment_ macro is not meant to be invoked in code")
};
($lit:literal) => {
$crate::_comment_! {}
};
}

// *** Error ***
Expand Down