Skip to content

Commit 7c66ae2

Browse files
committed
use ! in macro disambiguation suggestion
1 parent 150b49a commit 7c66ae2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Diff for: src/librustdoc/passes/collect_intra_doc_links.rs

+3
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,9 @@ fn ambiguity_error(
528528
Def::Method(..) | Def::Fn(..) => {
529529
("add parentheses", format!("{}()", path_str))
530530
}
531+
Def::Macro(..) => {
532+
("add an exclamation mark", format!("{}!", path_str))
533+
}
531534
_ => {
532535
let type_ = match (def, ns) {
533536
(Def::Const(..), _) => "const",

Diff for: src/test/rustdoc-ui/intra-links-ambiguity.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ help: to link to the function, add parentheses
4545
|
4646
LL | /// [`multi_conflict()`] is a three-way conflict.
4747
| ^^^^^^^^^^^^^^^^^^
48-
help: to link to the macro, prefix with the item type
48+
help: to link to the macro, add an exclamation mark
4949
|
50-
LL | /// [`macro@multi_conflict`] is a three-way conflict.
51-
| ^^^^^^^^^^^^^^^^^^^^^^
50+
LL | /// [`multi_conflict!`] is a three-way conflict.
51+
| ^^^^^^^^^^^^^^^^^
5252

5353
error: `type_and_value` is both a module and a constant
5454
--> $DIR/intra-links-ambiguity.rs:33:16

0 commit comments

Comments
 (0)