Skip to content

Rustdoc-Json: Don't loose subitems of foreign traits. - #101770

Merged
bors merged 1 commit into
rust-lang:masterfrom
aDotInTheVoid:rdj-index-clone
Sep 13, 2022
Merged

Rustdoc-Json: Don't loose subitems of foreign traits.#101770
bors merged 1 commit into
rust-lang:masterfrom
aDotInTheVoid:rdj-index-clone

Conversation

@aDotInTheVoid

Copy link
Copy Markdown
Member

Previously, we'd clone the index, and extend it with foreign traits. But when doing this, traits would render their subitems without them going into the index being used in the output leading to dangling ID's.

r? @GuillaumeGomez

@rustbotrustbot added A-rustdoc-json Area: Rustdoc JSON backend T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Sep 13, 2022
@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 13, 2022
@aDotInTheVoid

Copy link
Copy Markdown
MemberAuthor

This issue was found by jsondoclint, a replacement for check_missing_items.py (zulip). This is the last issue causing that to fail tests, so once this lands, I'll submit it for review.

@GuillaumeGomez

Copy link
Copy Markdown
Member

Can't wait for this new tool to be the default checker! Otherwise this PR looks good to me, thanks! r=me once CI pass

@bors delegate=aDotInTheVoid

@bors

bors commented Sep 13, 2022

Copy link
Copy Markdown
Collaborator

✌️ @aDotInTheVoid can now approve this pull request

@GuillaumeGomez

Copy link
Copy Markdown
Member

I'm not sure I entered the right way, so just in case:

@bors delegate=aDotInTheVoid

@bors

bors commented Sep 13, 2022

Copy link
Copy Markdown
Collaborator

✌️ @aDotInTheVoid can now approve this pull request

@aDotInTheVoid

Copy link
Copy Markdown
MemberAuthor

@bors r=GuillaumeGomez rollup

@bors

bors commented Sep 13, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit e80ccd3 has been approved by GuillaumeGomez

It is now in the queue for this repository.

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 13, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 13, 2022
…iaskrgr
Rollup of 7 pull requests
Successful merges:
- rust-lang#101266 (translations(rustc_session): migrates rustc_session to use SessionDiagnostic - Final)
- rust-lang#101737 (rustdoc: remove no-op CSS `.search-results .result-name > span`)
- rust-lang#101752 (Improve Attribute doc methods)
- rust-lang#101754 (Fix doc of log function)
- rust-lang#101759 (:arrow_up: rust-analyzer)
- rust-lang#101765 (Add documentation for TyCtxt::visibility)
- rust-lang#101770 (Rustdoc-Json: Don't loose subitems of foreign traits.)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit f04eee1 into rust-lang:masterSep 13, 2022
@rustbotrustbot added this to the 1.65.0 milestone Sep 13, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Sep 15, 2022
…aumeGomez
Replace `check_missing_items.py` with `jsondoclint`
[zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/check_missing_items.2Epy.20Replacement.2E)
check_missing_items.py was a python script that checked rustdoc json output to make sure all the Id's referenced existed in the JSON index. This PR replaces that with a rust binary (`jsondoclint`) that does the same thing.
### Motivation
1. Easier to change when `rustdoc-json-types` changes, as `jsondoclint` uses the types directly.
2. Better Errors:
- Multiple Errors can be emited for a single crate
- Errors can say where in JSON they occored
```
2:2889:408 not in index or paths, but refered to at '.index."2:2888:104".inner.items[0]'
2:2890:410 not in index or paths, but refered to at '.index."2:2888:104".inner.items[1]'
```
3. Catches more bugs.
- Because matches are exaustive, all posible variants considered for enums
- All Id's checked
- Has already found rust-lang#101770, rust-lang#101199 and rust-lang#100973
- Id type is also checked, so the Id's in a structs fields can only be field items.
4. Allows the possibility of running from `rustdoc::json`, which we should do in a crator run at some point.
cc `@CraftSpider`
r? `@GuillaumeGomez`
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Sep 15, 2022
…aumeGomez
Replace `check_missing_items.py` with `jsondoclint`
[zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/check_missing_items.2Epy.20Replacement.2E)
check_missing_items.py was a python script that checked rustdoc json output to make sure all the Id's referenced existed in the JSON index. This PR replaces that with a rust binary (`jsondoclint`) that does the same thing.
### Motivation
1. Easier to change when `rustdoc-json-types` changes, as `jsondoclint` uses the types directly.
2. Better Errors:
- Multiple Errors can be emited for a single crate
- Errors can say where in JSON they occored
```
2:2889:408 not in index or paths, but refered to at '.index."2:2888:104".inner.items[0]'
2:2890:410 not in index or paths, but refered to at '.index."2:2888:104".inner.items[1]'
```
3. Catches more bugs.
- Because matches are exaustive, all posible variants considered for enums
- All Id's checked
- Has already found rust-lang#101770, rust-lang#101199 and rust-lang#100973
- Id type is also checked, so the Id's in a structs fields can only be field items.
4. Allows the possibility of running from `rustdoc::json`, which we should do in a crator run at some point.
cc `@CraftSpider`
r? `@GuillaumeGomez`
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Sep 16, 2022
…aumeGomez
Replace `check_missing_items.py` with `jsondoclint`
[zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/check_missing_items.2Epy.20Replacement.2E)
check_missing_items.py was a python script that checked rustdoc json output to make sure all the Id's referenced existed in the JSON index. This PR replaces that with a rust binary (`jsondoclint`) that does the same thing.
### Motivation
1. Easier to change when `rustdoc-json-types` changes, as `jsondoclint` uses the types directly.
2. Better Errors:
- Multiple Errors can be emited for a single crate
- Errors can say where in JSON they occored
```
2:2889:408 not in index or paths, but refered to at '.index."2:2888:104".inner.items[0]'
2:2890:410 not in index or paths, but refered to at '.index."2:2888:104".inner.items[1]'
```
3. Catches more bugs.
- Because matches are exaustive, all posible variants considered for enums
- All Id's checked
- Has already found rust-lang#101770, rust-lang#101199 and rust-lang#100973
- Id type is also checked, so the Id's in a structs fields can only be field items.
4. Allows the possibility of running from `rustdoc::json`, which we should do in a crator run at some point.
cc ``@CraftSpider``
r? ``@GuillaumeGomez``
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-rustdoc-jsonArea: Rustdoc JSON backendS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@aDotInTheVoid@GuillaumeGomez@bors@rust-highfive@rustbot