Skip to content

Query docs show return types as <query_name as QueryConfig<TyCtxt<'tcx>>>::Stored #77459

Closed

Description

@jyn514

e.g. https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.hir_crate

This makes the docs really hard to read: you have to click on hir_crate, open impl<'tcx> QueryConfig<TyCtxt<'tcx>> for hir_crate, and know that Value is what actually matters, not Stored. This is super confusing and not documented anywhere. We should find a way to just put &'tcx Crate<'tcx> directly in the return type instead.

Activity

  1. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to Rust
    on Oct 2, 2020
  2. jyn514 commented on Oct 2, 2020

    @jyn514
    MemberAuthor
  3. jyn514 commented on Oct 2, 2020

    @jyn514
    MemberAuthor

    I'm not sure what's going on with Stored here:
    eval_to_const_value_raw returns EvalToConstValueResult (not a borrow), while
    generics_of returns &ty::Generics (a borrow). However in the query file both of them are listed as returning an owned value.

  4. jyn514 commented on Oct 2, 2020

    @jyn514
    MemberAuthor

    I think the difference is that generics_of uses ArenaCache, which returns a borrow? ugh

  5. jyn514 commented on Oct 2, 2020

    @jyn514
    MemberAuthor

    Maybe the fix should be for rustdoc to turn <X as Y>::Assoc into the actual type that describes? That would make the standard library docs easier to read too.

  6. added
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    on Oct 2, 2020
  7. added a commit that references this issue on Nov 26, 2020
  8. jyn514 commented on Nov 28, 2020

    @jyn514
    MemberAuthor

    Re-opening this until I fix #79459 properly.

  9. reopened this on Nov 28, 2020
  10. added a commit that references this issue on Nov 29, 2020
  11. added 2 commits that reference this issue on Dec 1, 2020
  12. jyn514 commented on Dec 12, 2020

    @jyn514
    MemberAuthor

    This was fixed for rustc by #79525. I guess we can reuse this as the tracking issue for enabling normalize-docs globally? I'm not planning to work on it myself but I'd love to remove the feature gate.

  13. jyn514 commented on Mar 2, 2021

    @jyn514
    MemberAuthor

    Closing this in favor of #82692, which has proper links and such so it's clear what this is blocked on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions