Skip to content

Multiple uses of --emit=dep-info do different things in rustc and rustdoc #141664

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

Open
aDotInTheVoid opened this issue May 27, 2025 · 0 comments
Open
Labels
C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@aDotInTheVoid
Copy link
Member

I tried this code:

#![doc=include_str!("hi.txt")]

And built it with --emit=dep-info passed twice as a CLI arg.

gh-aDotInTheVoid@dev-desktop-eu-1:~/tmp/depinfo$ rustc +nightly ./demo.rs --emit=dep-info=rustc1.d --emit=dep-info=rustc2.d
gh-aDotInTheVoid@dev-desktop-eu-1:~/tmp/depinfo$ rustdoc +nightly ./demo.rs --emit=dep-info=rustdoc1.d --emit=dep-info=rustdoc2.d

I expected to see this happen: rustc and rustdoc agree how to handle --emit=dep-info=<path> multiple times.

Instead, this happened: rustc picks the 2nd one, but rustdoc picks the first one.

gh-aDotInTheVoid@dev-desktop-eu-1:~/tmp/depinfo$ rustc +nightly ./demo.rs --emit=dep-info=rustc1.d --emit=dep-info=rustc2.d
gh-aDotInTheVoid@dev-desktop-eu-1:~/tmp/depinfo$ rustdoc +nightly ./demo.rs --emit=dep-info=rustdoc1.d --emit=dep-info=rustdoc2.d -Zunstable-options
gh-aDotInTheVoid@dev-desktop-eu-1:~/tmp/depinfo$ ls
demo.rs  doc  hi.txt  rustc2.d  rustdoc1.d

Meta

$ rustc +nightly -vV
rustc 1.89.0-nightly (2805e1dc4 2025-05-26)
binary: rustc
commit-hash: 2805e1dc4c18ed4c84d161502c48da870c56f68a
commit-date: 2025-05-26
host: aarch64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5
@aDotInTheVoid aDotInTheVoid added the C-bug Category: This is a bug. label May 27, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 27, 2025
@aDotInTheVoid aDotInTheVoid added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants