from me, even though this seems a bit late, so it might take a (long) while to transition.
Possible syntax: {path::to::Thing#method_or_field}. I don’t think this has any meaning in markdown, so we should be able to use it for our own purposes. Rustdoc should convert all of these into links to the respective page and strip the {}. This can possibly even be done inside of code blocks, since it either isn’t very useful Rust or even illegal Rust (and it would be whitespace-sensitive to enforce a common style for readability and to further differentiate from Rust code).
Some more thoughts:
- If a path isn’t resolved, should it be a hard error (generate no docs) or generate broken docs? Or should rustdoc generate broken docs, print an error and return an error code?
- Paths into
std and other included-by-default crates must be handled differently (the link has to point to the official documentation, since local docs don’t exist)
- We have to watch out for references to private fields/items, obviously, but these might be useful when generating internal documentation for an executable - in fact, their availability depends on which rustdoc passes are run on the crate that contains them
I’m not sure what you mean by this. Are there special-cased doc dependencies? Rustdoc will already build docs for all dependencies, so they are available.