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

rustdoc: Cleanup handling of associated items for intra-doc links #83849

Merged
merged 3 commits into from
Apr 6, 2021

Commits on Apr 5, 2021

  1. Configuration menu
    Copy the full SHA
    d63b3f9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ac04dbd View commit details
    Browse the repository at this point in the history
  3. Use more appropriate return type for resolve_associated_item

    Previously, the types looked like this:
    
    - None means this is not an associated item (but may be a variant field)
    - Some(Err) means this is known to be an error. I think the only way that can happen is if it resolved and but you had your own anchor.
    - Some(Ok(_, None)) was impossible.
    
    Now, this returns a nested Option and does the error handling and
    fiddling with the side channel in the caller. As a side-effect, it also
    removes duplicate error handling.
    
    This has one small change in behavior, which is that
    `resolve_primitive_associated_item` now goes through `variant_field` if
    it fails to resolve something.  This is not ideal, but since it will be
    quickly rejected anyway, I think the performance hit is worth the
    cleanup.
    
    This also fixes a bug where struct fields would forget to set the side
    channel, adds a test for the bug, and ignores `private_intra_doc_links`
    in rustc_resolve (since it's always documented with
    --document-private-items).
    jyn514 committed Apr 5, 2021
    Configuration menu
    Copy the full SHA
    3b7e654 View commit details
    Browse the repository at this point in the history