Skip to content

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

Open
@aDotInTheVoid

Description

@aDotInTheVoid

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-CLIArea: Command-line interface (CLI) to the compilerC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-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