about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-04-14 21:11:13 +0200
committerGitHub <noreply@github.com>2023-04-14 21:11:13 +0200
commit0d97522ee751cf485f3daf621bcc0ff1e6771f0f (patch)
treeac7856145104b4ee4f743aab205d27e09da2d2c4
parentd5c7237400129c3b47bd79983ab65b0a38752367 (diff)
parentd38fd29b5b2ed78ef801af19f8b6e6ae98f24210 (diff)
downloadrust-0d97522ee751cf485f3daf621bcc0ff1e6771f0f.tar.gz
rust-0d97522ee751cf485f3daf621bcc0ff1e6771f0f.zip
Rollup merge of #110328 - GuillaumeGomez:auto-disambiguation-proc-trait, r=notriddle
[rustdoc] Add explanations for auto-disambiguation when an intra doc link is resolved to a proc-macro and a trait at the same time

Part of https://github.com/rust-lang/rust/issues/110111.

r? `@notriddle`
-rw-r--r--src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md b/src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md
index 36bc312b9c9..eb2285ef906 100644
--- a/src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md
+++ b/src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md
@@ -103,6 +103,13 @@ macro_rules! foo {
 }
 ```
 
+There is one case where the disambiguation will be performed automatically: if an intra doc
+link is resolved at the same time as a trait and as a derive proc-macro. In this case, it'll
+always generate a link to the trait and not emit a "missing disambiguation" warning. A good
+example of this case is when you link to the `Clone` trait: there is also a `Clone`
+proc-macro but it ignores it in this case. If you want to link to the proc-macro, you can
+use the `macro@` disambiguator.
+
 ## Warnings, re-exports, and scoping
 
 Links are resolved in the scope of the module where the item is defined, even