Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: Prevent duplicated imports #108349

Merged
merged 3 commits into from
Feb 23, 2023

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Feb 22, 2023

Fixes #108163.

Interestingly enough, the AST is providing us an import for each corresponding item, even though the Res links to multiple ones each time, which leaded to the same import being duplicated.

So in this PR, I decided to prevent the add of the import before the clean pass. However, I originally took a different path by instead filtering after cleaning the path. You can see it here. Only the second commit differs.

I think this approach is better though, but at least we can compare both if we want.

The first commit adds the check for duplicated items in the rustdoc-json output as asked in #108163.

cc @aDotInTheVoid
r? @notriddle

@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 22, 2023
@notriddle
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 22, 2023

📌 Commit 20dd1bd has been approved by notriddle

It is now in the queue for this repository.

@bors bors 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 Feb 22, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 23, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#108063 (Ban associated type bounds in bad positions)
 - rust-lang#108208 (Correctly handle aggregates in DataflowConstProp)
 - rust-lang#108218 (Windows: Quote more batch file arguments)
 - rust-lang#108349 (rustdoc: Prevent duplicated imports)
 - rust-lang#108350 (Use associated type bounds in some places in the compiler)
 - rust-lang#108358 (Add git config command to `.git-blame-ignore-revs`)
 - rust-lang#108373 (hir-analysis: make where-clause-on-main diagnostic translatable)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2011ced into rust-lang:master Feb 23, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 23, 2023
@GuillaumeGomez GuillaumeGomez deleted the fix-duplicated-imports2 branch February 23, 2023 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-json Area: Rustdoc JSON backend S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant 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.

jsondoclint: Check that ID lists don't have duplicates
4 participants