Skip to content

Rustdoc-Json: Document Stripped Fields for enum varients #100587

Closed
@aDotInTheVoid

Description

@aDotInTheVoid
Member

At some point their should also be a has_striped_fields for Variant, and probably a way to tell what position each of the non stripped items are, as currently each of these 3 variants are documented with the same inner.

enum Foo {
  A(i32)
  B(i32, #[doc(hidden)] i32)
  C(#[doc(hidden)] i32, i32)
}

but HTML gets a good representation:

The solution is probably to do what we do for structs, and store the StructType, and a Vec<Id>, such that each field of a varient gets an Item to hold the name. We also should have a num_fields, as even in that schema, you can't tell the difference between

enum Foo {
  A(#[doc(hidden)] i32),
  B(#[doc(hidden)]i32, #[doc(hidden)]i32)
}

This also effects struct AFAIKT.

I don't think this needs to be done now. I'll file an issue for it.

Originally posted by @aDotInTheVoid in #100582 (comment)

@rustbot modify labels: +A-rustdoc-json +T-rustdoc

Activity

added
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
on Aug 15, 2022
aDotInTheVoid

aDotInTheVoid commented on Aug 19, 2022

@aDotInTheVoid
MemberAuthor

Related: #92945

added a commit that references this issue on Sep 6, 2022

Rollup merge of rust-lang#101462 - aDotInTheVoid:rdj-enum-field-2, r=…

b59c1aa
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-rustdoc-jsonArea: Rustdoc JSON backendT-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

      Participants

      @aDotInTheVoid@rustbot

      Issue actions

        Rustdoc-Json: Document Stripped Fields for enum varients · Issue #100587 · rust-lang/rust