rust/src
bors 9ba1d21868 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`
2020-10-09 02:27:33 +00:00
..
bootstrap Auto merge of #77631 - jyn514:helpful-changelog, r=RalfJung 2020-10-08 05:50:49 +00:00
build_helper cleanup: Remove duplicate library names from Cargo.tomls 2020-08-30 22:57:54 +03:00
ci Check all Cargo targets on CI 2020-10-03 09:53:13 -04:00
doc Auto merge of #77119 - GuillaumeGomez:unclosed-html-tag-lint, r=jyn514 2020-10-07 09:56:51 +00:00
etc Unset GIT_DIR in pre-commit hook 2020-10-07 19:50:27 -04:00
librustdoc Auto merge of #77519 - jyn514:track-doc-er, r=GuillaumeGomez 2020-10-09 02:27:33 +00:00
llvm-project@3adf16e0cb Update submodule llvm to get LVI bugfix 2020-10-08 17:43:26 +02:00
test Auto merge of #77519 - jyn514:track-doc-er, r=GuillaumeGomez 2020-10-09 02:27:33 +00:00
tools Auto merge of #77637 - ehuss:update-cargo, r=ehuss 2020-10-07 05:12:28 +00:00
README.md Update README.md 2020-08-30 13:40:11 -05:00
stage0.txt Bump to 1.48 bootstrap compiler 2020-10-07 19:51:36 -04:00
version Bump version to 1.49.0 2020-10-02 08:39:40 -04:00

This directory contains the source code of the rust project, including:

  • The test suite
  • The bootstrapping build system
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.