1
Fork 0

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`
This commit is contained in:
Matthias Krüger 2023-04-14 21:11:13 +02:00 committed by GitHub
commit 0d97522ee7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 ## Warnings, re-exports, and scoping
Links are resolved in the scope of the module where the item is defined, even Links are resolved in the scope of the module where the item is defined, even