Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Rustdoc JSON: Duplicated ID's in lists #108236

Closed

Description

@aDotInTheVoid
          Looking at the output (of `tests/rustdoc-json/reexport/same_name_different_types.rs`), for some reason it's duplicating ID's in the output:
  "index": {
    "0:0:1588": {
      "crate_id": 0,
      "docs": null,
      "id": "0:0:1588",
      "inner": {
        "is_crate": true,
        "is_stripped": false,
        "items": [
          "0:1:1582",
          "0:4-0:2:1584",
          "0:4-0:3:1584",
          "0:4-0:2:1584",
          "0:4-0:3:1584",
          "0:5-0:2:1584",
          "0:5-0:3:1584",
          "0:5-0:2:1584",
          "0:5-0:3:1584"
        ]
      },
      "kind": "module",
      "name": "same_name_different_types"
    },

I'm not really sure whats causing this, but idealy it wouldn't happen, although I'd be willing to merge as is, as long as an issue gets created to follow up.

(Also, jsondoclint should probably catch this)

Originally posted by @aDotInTheVoid in #107766 (comment)

CC: #108163

Activity

  1. shogohida commented on Feb 20, 2023

    @shogohida

    Hi @aDotInTheVoid, can I work on this? I searched a bit for the source code but I don't know where to start yet...

  2. aDotInTheVoid commented on Feb 20, 2023

    @aDotInTheVoid
    MemberAuthor

    Your more than welcome to!

    Convertion from clean to json for module's happens here, and it just passes of ID's coming from clean

    ModuleItem(m) => {
    ItemEnum::Module(Module { is_crate, items: ids(m.items, tcx), is_stripped: false })
    }

    Clean makes it's modules here

    pub(crate) fn clean_doc_module<'tcx>(doc: &DocModule<'tcx>, cx: &mut DocContext<'tcx>) -> Item {

    I'd start by adding debug! calls to see whats going on here. See the rustc dev guide for info on how the debug macros work for rustc. Feel free to ask questions on zulip if you have any

  3. added
    T-rustdoc
    A-rustdoc-json
    on Feb 20, 2023
  4. GuillaumeGomez commented on Feb 23, 2023

    @GuillaumeGomez
    Member

    It was fixed in #108349.

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-jsonT-rustdoc

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions