about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/allocator.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-10-09 02:27:33 +0000
committerbors <bors@rust-lang.org>2020-10-09 02:27:33 +0000
commit9ba1d21868968e1a4cbbe953371afbd43ad07c72 (patch)
tree4222a141e26b86266c60ce9c3c8e8f0ee6de2eea /compiler/rustc_codegen_llvm/src/allocator.rs
parent03ef8a081ef713609a65e71ed41c6775aeb138aa (diff)
parente39a86019d79d0f2dc5f6cc94fcdf2f073b478e9 (diff)
downloadrust-9ba1d21868968e1a4cbbe953371afbd43ad07c72.tar.gz
rust-9ba1d21868968e1a4cbbe953371afbd43ad07c72.zip
Auto merge of #77519 - jyn514:track-doc-er, r=GuillaumeGomez
Resolve intra-doc links on additional documentation for re-exports in lexical scope

Fixes https://github.com/rust-lang/rust/issues/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`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/allocator.rs')
0 files changed, 0 insertions, 0 deletions