Skip to content

Rustdoc-Json: Fake span given for auto trait impls #100283

Closed

Description

// Signifigant whitespace


pub struct Foo;

gives

    "a:2:9232:1965-0:3:1539": {
      "attrs": [],
      "crate_id": 0,
      "deprecation": null,
      "docs": null,
      "id": "a:2:9232:1965-0:3:1539",
      "inner": {
        "blanket_impl": null,
        "for": {
          "inner": {
            "args": {
              "angle_bracketed": {"args": [], "bindings": []}
            },
            "id": "0:3:1539",
            "name": "Foo",
            "param_names": []
          },
          "kind": "resolved_path"
        },
        "generics": {"params": [], "where_predicates": []},
        "is_unsafe": false,
        "items": [],
        "negative": false,
        "provided_trait_methods": [],
        "synthetic": true,
        "trait": {
          "inner": {
            "args": {
              "angle_bracketed": {"args": [], "bindings": []}
            },
            "id": "2:9232:1965",
            "name": "RefUnwindSafe",
            "param_names": []
          },
          "kind": "resolved_path"
        }
      },
      "kind": "impl",
      "links": {},
      "name": null,
      "span": {
        "begin": [1, 0],
        "end": [1, 0],
        "filename": "bad.rs"
      },
      "visibility": "default"
    }

with a given span of {"begin": [1, 0], "end": [1, 0], "filename": "bad.rs" }, which is not correct.

I think the span should probably be None/null in this case, which is suported without changing the schema (span: Option<Span> in rustdoc_json_types::Item

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

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

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

    Development

    No branches or pull requests

    Issue actions