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

Fix doc collision for lib/bin with a dash in the inferred name. #13640

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Mar 25, 2024

This fixes an issue where cargo doc would report a collision if the project has a - in the name, and both a lib and bin. As a consequence of the change in #12783, the target name for the library no longer has a -. The code that checks for the lib/bin doc collision was only checking if the target names were equal, which is no longer the case after #12783. The solution here is to use the crate_name and not the target name, which has the appropriate _ translation done. This is the more correct method to use, even before #12783, because rustdoc uses crate names, not target names (and thus even documenting bins have their filenames converted to underscores).

Fixes #13628

@rustbot
Copy link
Collaborator

rustbot commented Mar 25, 2024

r? @epage

rustbot has assigned @epage.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-cargo-targets Area: selection and definition of targets (lib, bins, examples, tests, benches) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 25, 2024
@epage
Copy link
Contributor

epage commented Mar 25, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Mar 25, 2024

📌 Commit 3adb796 has been approved by epage

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 Mar 25, 2024
@bors
Copy link
Collaborator

bors commented Mar 25, 2024

⌛ Testing commit 3adb796 with merge c56140f...

@bors
Copy link
Collaborator

bors commented Mar 25, 2024

☀️ Test successful - checks-actions
Approved by: epage
Pushing c56140f to master...

@bors bors merged commit c56140f into rust-lang:master Mar 25, 2024
21 checks passed
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 26, 2024
…rkingjubilee

Update cargo

5 commits in a510712d05c6c98f987af24dd73cdfafee8922e6..499a61ce7a0fc6a72040084862a68b2603e770e8
2024-03-25 03:45:54 +0000 to 2024-03-26 04:17:04 +0000
- fix: do not borrow shell across registry query (rust-lang/cargo#13647)
- Do not strip debuginfo by default for MSVC (rust-lang/cargo#13630)
- chore(deps): update msrv (rust-lang/cargo#13577)
- Fix doc collision for lib/bin with a dash in the inferred name. (rust-lang/cargo#13640)
- refactor: Make lint names snake_case (rust-lang/cargo#13635)

r? ghost
@rustbot rustbot added this to the 1.79.0 milestone Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cargo-targets Area: selection and definition of targets (lib, bins, examples, tests, benches) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cargo doc fails for bin+lib projects with - in the name
4 participants