Skip to content

Commit 0d97522

Browse files
authored
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 #110111. r? `@notriddle`
2 parents d5c7237 + d38fd29 commit 0d97522

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md

+7
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ macro_rules! foo {
103103
}
104104
```
105105

106+
There is one case where the disambiguation will be performed automatically: if an intra doc
107+
link is resolved at the same time as a trait and as a derive proc-macro. In this case, it'll
108+
always generate a link to the trait and not emit a "missing disambiguation" warning. A good
109+
example of this case is when you link to the `Clone` trait: there is also a `Clone`
110+
proc-macro but it ignores it in this case. If you want to link to the proc-macro, you can
111+
use the `macro@` disambiguator.
112+
106113
## Warnings, re-exports, and scoping
107114

108115
Links are resolved in the scope of the module where the item is defined, even

0 commit comments

Comments
 (0)