#[doc = crate::_tags!(internal)]
#[doc = crate::_doc_meta!{location("yard")}]
#[cfg_attr(cargo_primary_package, doc(hidden))]
#[cfg_attr(not(feature = "__docs_internal"), doc(hidden))]
#[cfg_attr(nightly_doc, doc(cfg(feature = "__docs_internal")))]
#[macro_export]
macro_rules! _doc_meta· {
(@items) => { "" };
(@items ,) => { "" };
(@items location($($args:tt)*) $(, $($rest:tt)*)?) => {
concat!(
$crate::_doc_location!(%from_meta $($args)*),
$crate::_doc_meta!(@items $($($rest)*)?)
)
};
(@items $(#[$meta:meta])* test_size_of($($args:tt)*) $(, $($rest:tt)*)?) => {
concat!(
$crate::_doc_test_size_of!($(#[$meta])* $($args)*),
$crate::_doc_meta!(@items $($($rest)*)?)
)
};
(@items origin(rust $root:ident $(:: $path:ident)* $(;
renamed($($old:ident as $new:ident),* $(,)?))?) $(, $($rest:tt)*)?) => {
concat!(" ",
$crate::_doc_meta!(@emit_origin_rust $root $(:: $path)* ; $($($old as $new),*)?),
$crate::_doc_meta!(@items $($($rest)*)?)
)
};
(@items origin(crate $dep:literal
$(; renamed($($old:ident as $new:ident),* $(,)?))?) $(, $($rest:tt)*)?) => {
concat!(" ",
$crate::_doc_meta!(@emit_origin_crate $dep; $($($old as $new),*)?),
$crate::_doc_meta!(@items $($($rest)*)?)
)
};
(@items origin(crate $shown:literal => $docs:literal
$(; renamed($($old:ident as $new:ident),* $(,)?))?) $(, $($rest:tt)*)?) => {
concat!(" ",
$crate::_doc_meta!(@emit_origin_crate_as $shown => $docs; $($($old as $new),*)?),
$crate::_doc_meta!(@items $($($rest)*)?)
)
};
(@emit_origin_rust $root:ident $(:: $path:ident)* ; $($renamed:tt)*) => {
concat!(
"<sup>re-exported from <a title='location in `", ::core::stringify!($root),
"`' href=\"https://doc.rust-lang.org/", ::core::stringify!($root), "/",
$( ::core::stringify!($path), "/", )* "\">", ::core::stringify!($root),
$("::", ::core::stringify!($path),)* "</a>",
$crate::_doc_meta!(@emit_renamed $($renamed)*), "</sup>"
)
};
(@emit_origin_crate $dep:literal; $($renamed:tt)*) => {
concat!(
"<sup>re-exported from the <a title='docs for `", $dep,
"`' href=\"https://docs.rs/", $dep, "\">", $dep, "</a> crate",
$crate::_doc_meta!(@emit_renamed $($renamed)*), ".</sup>"
)
};
(@emit_origin_crate_as $shown:literal => $docs:literal; $($renamed:tt)*) => {
concat!(
"<sup>re-exported from the <a title='docs for `", $shown,
"`' href=\"https://docs.rs/", $docs, "\">", $shown, "</a> crate",
$crate::_doc_meta!(@emit_renamed $($renamed)*), ".</sup>"
)
};
(@emit_renamed) => { "" };
(@emit_renamed $($old:ident as $new:ident),+ $(,)?) => {
concat!( " ", $( "`::", stringify!($old), "` as `", stringify!($new), "` " ),+)
};
(@items $bad:ident($($args:tt)*) $(, $($rest:tt)*)?) => {
compile_error!(concat!("unknown _doc_meta! section: `", stringify!($bad), "`"))
};
(@items $($bad:tt)+) => {
compile_error!(concat!("could not parse _doc_meta! input near: `",
stringify!($($bad)+), "`"))
};
() => { "" };
($($rest:tt)+) => {
concat!(
"\n\n---\n\n",
$crate::_doc_meta!(@items $($rest)+),
"\n\n---\n\n",
)
};
}
#[doc(inline)]
pub use _doc_meta· as _doc_meta;