2021-11-26 17:03:16 -06:00
|
|
|
#![deny(rustdoc::broken_intra_doc_links)]
|
2020-11-28 19:25:41 -06:00
|
|
|
// first try backticks
|
|
|
|
/// Trait: [`trait@Name`], fn: [`fn@Name`], [`Name`][`macro@Name`]
|
|
|
|
// @has disambiguators_removed/struct.AtDisambiguator.html
|
2021-03-17 13:41:01 -05:00
|
|
|
// @has - '//a[@href="trait.Name.html"][code]' "Name"
|
|
|
|
// @has - '//a[@href="fn.Name.html"][code]' "Name"
|
|
|
|
// @has - '//a[@href="macro.Name.html"][code]' "Name"
|
2020-11-28 19:25:41 -06:00
|
|
|
pub struct AtDisambiguator;
|
|
|
|
|
|
|
|
/// fn: [`Name()`], macro: [`Name!`]
|
|
|
|
// @has disambiguators_removed/struct.SymbolDisambiguator.html
|
2021-03-17 13:41:01 -05:00
|
|
|
// @has - '//a[@href="fn.Name.html"][code]' "Name()"
|
|
|
|
// @has - '//a[@href="macro.Name.html"][code]' "Name!"
|
2020-11-28 19:25:41 -06:00
|
|
|
pub struct SymbolDisambiguator;
|
|
|
|
|
|
|
|
// Now make sure that backticks aren't added if they weren't already there
|
|
|
|
/// [fn@Name]
|
|
|
|
// @has disambiguators_removed/trait.Name.html
|
2021-03-17 13:41:01 -05:00
|
|
|
// @has - '//a[@href="fn.Name.html"]' "Name"
|
|
|
|
// @!has - '//a[@href="fn.Name.html"][code]' "Name"
|
2020-11-28 19:25:41 -06:00
|
|
|
|
|
|
|
// FIXME: this will turn !() into ! alone
|
|
|
|
/// [Name!()]
|
2021-03-17 13:41:01 -05:00
|
|
|
// @has - '//a[@href="macro.Name.html"]' "Name!"
|
2020-11-28 19:25:41 -06:00
|
|
|
pub trait Name {}
|
|
|
|
|
|
|
|
#[allow(non_snake_case)]
|
|
|
|
|
|
|
|
// Try collapsed reference links
|
|
|
|
/// [macro@Name][]
|
|
|
|
// @has disambiguators_removed/fn.Name.html
|
2021-03-17 13:41:01 -05:00
|
|
|
// @has - '//a[@href="macro.Name.html"]' "Name"
|
2020-11-28 19:25:41 -06:00
|
|
|
|
|
|
|
// Try links that have the same text as a generated URL
|
2021-03-17 13:41:01 -05:00
|
|
|
/// Weird URL aligned [macro.Name.html][trait@Name]
|
|
|
|
// @has - '//a[@href="trait.Name.html"]' "macro.Name.html"
|
2020-11-28 19:25:41 -06:00
|
|
|
pub fn Name() {}
|
|
|
|
|
|
|
|
#[macro_export]
|
|
|
|
// Rustdoc doesn't currently handle links that have weird interspersing of inline code blocks.
|
|
|
|
/// [fn@Na`m`e]
|
|
|
|
// @has disambiguators_removed/macro.Name.html
|
2021-03-17 13:41:01 -05:00
|
|
|
// @has - '//a[@href="fn.Name.html"]' "fn@Name"
|
2020-11-28 19:25:41 -06:00
|
|
|
|
|
|
|
// It also doesn't handle any case where the code block isn't the whole link text:
|
|
|
|
/// [trait@`Name`]
|
2021-03-17 13:41:01 -05:00
|
|
|
// @has - '//a[@href="trait.Name.html"]' "trait@Name"
|
2020-11-28 19:25:41 -06:00
|
|
|
macro_rules! Name {
|
|
|
|
() => ()
|
|
|
|
}
|