#![allow(unused)]
macro_rules! _DOCLINK_CUSTOM_DOMAIN {
() => {
"https://docs.rs/"
};
}
pub(crate) use _DOCLINK_CUSTOM_DOMAIN;
#[cfg(feature = "__publish")]
#[allow(clippy::crate_in_macro_def, reason = "crate::__crate_name! is intended")]
macro_rules! _doclink {
(
/* links to either a custom domain or a local URL */
// [anchor]: https://…/crate/item_path
// [anchor]: file://…/current_crate/item_path/index.html
custom crate $anchor:literal $item_path:literal
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat!["\n\n", $anchor, ": ",
$crate::doclink![custom crate $item_path $(@mod$($_m)?)? $($jump_link)?]]
};
( custom crate $item_path:literal
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat![crate::_DOCLINK_CUSTOM_DOMAIN!(),
crate::__crate_name!(), env!("CARGO_CRATE_NAME"),
"/latest/", crate::__crate_name!(), "/", $item_path $(, $jump_link)?]
};
(
custom $crate_name:ident $anchor:literal $item_path:literal
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat!["\n\n", $anchor, ": ",
$crate::doclink![custom $crate_name $item_path $(@mod$($_m)?)? $($jump_link)?]]
};
( custom $crate_name:ident $item_path:literal
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat![crate::_DOCLINK_CUSTOM_DOMAIN!(), ::core::stringify!($crate_name),
"/latest/", ::core::stringify!($crate_name), "/", $item_path $(, $jump_link)?]
};
( custom_current_crate $item_path:expr,
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat![crate::_DOCLINK_CUSTOM_DOMAIN!(), crate::__crate_name!(),
"/latest/", crate::__crate_name!(), "/", $item_path $(, $jump_link)?]
};
( custom_current_proc_crate
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
concat![crate::_DOCLINK_CUSTOM_DOMAIN!(), crate::__crate_name!(),
"/latest/", crate::__crate_name!(), "/" $(, $jump_link)?]
};
(
crate $anchor:literal $item_path:literal
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat!["\n\n", $anchor, ": ",
$crate::doclink![crate $item_path $(@mod$($_m)?)? $($jump_link)?]]
};
( crate $item_path:literal
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat!["https://docs.rs/",
crate::__crate_name!(), env!("CARGO_CRATE_NAME"),
"/latest/", crate::__crate_name!(), "/", $item_path $(, $jump_link)?]
};
(
$crate_name:ident $anchor:literal $item_path:literal
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat!["\n\n", $anchor, ": ",
$crate::doclink![$crate_name $item_path $(@mod$($_m)?)? $($jump_link)?]]
};
( $crate_name:ident $item_path:literal
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat!["https://docs.rs/", ::core::stringify!($crate_name),
"/latest/", ::core::stringify!($crate_name), "/", $item_path $(, $jump_link)?]
};
( current_crate $item_path:literal
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat!["https://docs.rs/", crate::__crate_name!(),
"/latest/", crate::__crate_name!(), "/", $item_path $(, $jump_link)?]
};
( current_proc_crate
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
concat!["https://docs.rs/", crate::__crate_name!(),
"/latest/", crate::__crate_name!(), "/" $(, $jump_link)?]
};
}
#[cfg(not(feature = "__publish"))]
#[allow(clippy::crate_in_macro_def, reason = "crate::__crate_name! is intended")]
macro_rules! _doclink {
(
/* links to either a custom domain or a local URL */
// [anchor]: file://…/current_crate/item_path/index.html
custom crate $anchor:literal $item_path:literal
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat!["\n\n", $anchor, ": ",
$crate::doclink![custom crate $item_path $(@mod$($_m)?)? $($jump_link)?]]
};
( custom crate $item_path:literal
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat!["file://", env!("CARGO_TARGET_DIR"), "doc/",
env!("CARGO_CRATE_NAME"), "/", $item_path $(, "/index.html"$($_m)?)? $(, $jump_link)?]
};
(
custom $crate_name:ident $anchor:literal $item_path:literal
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat!["\n\n", $anchor, ": ",
$crate::doclink![custom $crate_name $item_path $(@mod$($_m)?)? $(, $jump_link)?]]
};
( custom $crate_name:ident $item_path:literal
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat!["file://", env!("CARGO_TARGET_DIR"), "doc/",
::core::stringify!($crate_name), "/", $item_path $(, "/index.html"$($_m)?)?
$(, $jump_link)?]
};
( custom_current_crate $item_path:expr,
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat!["file://", env!("CARGO_TARGET_DIR"), "doc/",
crate::__crate_name!(), "/", $item_path $(, "/index.html"$($_m)?)? $(, $jump_link)?]
};
( custom_current_proc_crate
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
concat!["file://", env!("CARGO_TARGET_DIR"), "doc/",
crate::__crate_name!(), $("/index.html"$($_m)?)? $(, $jump_link)?]
};
(
crate $anchor:literal $item_path:literal
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat!["\n\n", $anchor, ": ",
$crate::doclink![crate $item_path $(@mod$($_m)?)? $($jump_link)?]]
};
( crate $item_path:literal
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat!["file://", env!("CARGO_TARGET_DIR"), "doc/",
env!("CARGO_CRATE_NAME"), "/", $item_path $(, "/index.html"$($_m)?)? $(, $jump_link)?]
};
(
$crate_name:ident $anchor:literal $item_path:literal
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat!["\n\n", $anchor, ": ",
$crate::doclink![$crate_name $item_path $(@mod$($_m)?)? $($jump_link)?]]
};
( $crate_name:ident $item_path:literal
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat!["file://", env!("CARGO_TARGET_DIR"), "doc/",
::core::stringify!($crate_name), "/", $item_path $(, "/index.html"$($_m)?)?
$(, $jump_link)?]
};
( current_crate $item_path:literal
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
::core::concat!["file://", env!("CARGO_TARGET_DIR"), "doc/",
crate::__crate_name!(), "/", $item_path $(, "/index.html"$($_m)?)? $(, $jump_link)?]
};
( current_proc_crate
$(@mod$($_m:lifetime)?)? $($jump_link:literal)?) => {
concat!["file://", env!("CARGO_TARGET_DIR"), "doc/",
crate::__crate_name!(), $("/index.html"$($_m)?)? $(, $jump_link)? $(, $jump_link)?]
};
}
pub(crate) use _doclink as doclink;