diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index b105e0a0b6fcc..0fa6b6baec79d 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -528,6 +528,9 @@ fn ambiguity_error( Def::Method(..) | Def::Fn(..) => { ("add parentheses", format!("{}()", path_str)) } + Def::Macro(..) => { + ("add an exclamation mark", format!("{}!", path_str)) + } _ => { let type_ = match (def, ns) { (Def::Const(..), _) => "const", diff --git a/src/test/rustdoc-ui/intra-links-ambiguity.stderr b/src/test/rustdoc-ui/intra-links-ambiguity.stderr index b85161dc1469e..ad63f13493ddb 100644 --- a/src/test/rustdoc-ui/intra-links-ambiguity.stderr +++ b/src/test/rustdoc-ui/intra-links-ambiguity.stderr @@ -45,10 +45,10 @@ help: to link to the function, add parentheses | LL | /// [`multi_conflict()`] is a three-way conflict. //~ERROR `multi_conflict` | ^^^^^^^^^^^^^^^^^^ -help: to link to the macro, prefix with the item type +help: to link to the macro, add an exclamation mark | -LL | /// [`macro@multi_conflict`] is a three-way conflict. //~ERROR `multi_conflict` - | ^^^^^^^^^^^^^^^^^^^^^^ +LL | /// [`multi_conflict!`] is a three-way conflict. //~ERROR `multi_conflict` + | ^^^^^^^^^^^^^^^^^ error: `type_and_value` is both a module and a constant --> $DIR/intra-links-ambiguity.rs:33:16