Skip to content

Commit

Permalink
use ! in macro disambiguation suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
euclio committed Mar 15, 2019
1 parent 150b49a commit 7c66ae2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/librustdoc/passes/collect_intra_doc_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/test/rustdoc-ui/intra-links-ambiguity.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ help: to link to the function, add parentheses
|
LL | /// [`multi_conflict()`] is a three-way 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.
| ^^^^^^^^^^^^^^^^^^^^^^
LL | /// [`multi_conflict!`] is a three-way conflict.
| ^^^^^^^^^^^^^^^^^

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

0 comments on commit 7c66ae2

Please sign in to comment.