Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix intra-doc links for cross-crate re-exports of default trait methods #75176

Merged
merged 3 commits into from
Aug 30, 2020

Commits on Aug 29, 2020

  1. rustdoc: Fix intra-doc links for cross-crate re-exports of traits

     rust-lang#58972 ignored extern_traits because before rust-lang#65983 was fixed, they
    would always fail to resolve, giving spurious warnings.
    This undoes that change, so extern traits are now seen by the
    `collect_intra_doc_links` pass. There are also some minor changes in
    librustdoc/fold.rs to avoid borrowing the extern_traits RefCell more
    than once at a time.
    jyn514 committed Aug 29, 2020
    Configuration menu
    Copy the full SHA
    868927f View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2020

  1. rustdoc,metadata: Debugging

    jyn514 committed Aug 30, 2020
    Configuration menu
    Copy the full SHA
    a1c71a1 View commit details
    Browse the repository at this point in the history
  2. resolve: Don't speculatively load crates if this is a speculative res…

    …olution
    
    This avoids a rare rustdoc bug where loading `core` twice caused a
    'cannot find a built-in macro' error:
    
    1. `x.py build --stage 1` builds the standard library and creates a sysroot
    2. `cargo doc` does something like `cargo check` to create `rmeta`s for all the crates (unrelated to what was built above)
    3. the `cargo check`-like `libcore-*.rmeta` is loaded as a transitive dependency *and claims ownership* of builtin macros
    4. `rustdoc` later tries to resolve some path in a doc link
    5. suggestion logic fires and loads "extern prelude" crates by name
    6. the sysroot `libcore-*.rlib` is loaded and *fails to claim ownership* of builtin macros
    
    This fixes step 5. by not running suggestion logic if this is a
    speculative resolution. Additionally, it marks `resolve_ast_path` as a
    speculative resolution.
    jyn514 committed Aug 30, 2020
    Configuration menu
    Copy the full SHA
    9131d23 View commit details
    Browse the repository at this point in the history