-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #77519 - jyn514:track-doc-er, r=GuillaumeGomez
Resolve intra-doc links on additional documentation for re-exports in lexical scope Fixes #77254. - Preserve the parent module of `DocFragment`s + Add `parent_module` to `DocFragment` + Require the `parent_module` of the item being inlined + Preserve the hir_id for ExternCrates so rustdoc can find the parent module later + Take an optional `parent_module` for `build_impl` and `merge_attrs`. Preserve the difference between parent modules for each doc-comment. + Support a single additional re-exports in from_ast. Originally this took a vec but I ended up not using it. + Don't require the parent_module for all `impl`s, just inlined items In particular, this will be `None` whenever the attribute is not on a re-export. + Only store the parent_module, not the HirId When re-exporting a re-export, the HirId is not available. Fortunately, `collect_intra_doc_links` doesn't actually need all the info from a HirId, just the parent module. - Introduce `Divider` This distinguishes between documentation on the original from docs on the re-export. - Use the new module information for intra-doc links + Make the parent module conditional on whether the docs are on a re-export + Make `resolve_link` take `&Item` instead of `&mut Item` Previously the borrow checker gave an error about multiple mutable borrows, because `dox` borrowed from `item`. + Fix `crate::` for re-exports `crate` means something different depending on where the attribute came from. + Make it work for `#[doc]` attributes too This required combining several attributes as one so they would keep the links. r? `@GuillaumeGomez`
- Loading branch information
Showing
10 changed files
with
235 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.