rust/src/doc/rustdoc
bors f79ef02e4b Auto merge of #130587 - coolreader18:field-variant-doclink-disambig, r=notriddle,jyn514
Add `field@` and `variant@` doc-link disambiguators

I'm not sure if this is big enough to need an fcp or not, but this is something I found missing when trying to refer to a field in macro-generated docs, not knowing if a method might be defined as well. Obviously, there are definitely other uses.

In the case where it's not disambiguated, methods (and I suppose other associated items in the value namespace) still take priority, which `@jyn514` said was an oversight but I think is probably the desired behavior 99% of the time anyway - shadowing a field with an accessor method is a very common pattern. If fields and methods with the same name started conflicting, it would be a breaking change. Though, to quote them:

> jyn: maybe you can break this only if both [the method and the field] are public
> jyn: rustc has some future-incompat warning level
> jyn: that gets through -A warnings and --cap-lints from cargo

That'd be out of scope of this PR, though.

Fixes #80283
2024-10-01 01:45:35 +00:00
..
src Auto merge of #130587 - coolreader18:field-variant-doclink-disambig, r=notriddle,jyn514 2024-10-01 01:45:35 +00:00
.gitignore add a new mdbook for rustdoc 2017-05-31 12:46:17 -04:00
book.toml doc(rustdoc): redirect more urls 2022-10-27 00:17:16 +08:00
README.md Stabilize extended_key_value_attributes 2021-05-18 01:01:36 -04:00

Rustdoc

This is documentation for rustdoc itself, written in mdbook format. To build the book, use x.py doc src/doc/rustdoc. To run doctests, use x.py test src/doc/rustdoc.