Skip to content

Multiple emit targets don’t ignore -o option, contrary to the warning #20130

Closed
@nagisa

Description

@nagisa
$ ls -alh
…
drwxr-xr-x 1 nagisa nagisa  26 Dec 22 11:32 src/
…
$ rustc src/lib.rs --emit=llvm-ir,llvm-bc,obj,asm,link --crate-type=rlib -o rdd
warning: ignoring specified output filename because multiple outputs were requested
$ ls -alh
total 136K
…
-rw-r--r-- 1 nagisa nagisa  86K Dec 22 16:41 liblib.rlib
-rw-r--r-- 1 nagisa nagisa 5.1K Dec 22 16:41 rdd.bc
-rw-r--r-- 1 nagisa nagisa  17K Dec 22 16:41 rdd.ll
-rw-r--r-- 1 nagisa nagisa 9.7K Dec 22 16:41 rdd.o
-rw-r--r-- 1 nagisa nagisa  16K Dec 22 16:41 rdd.s
drwxr-xr-x 1 nagisa nagisa  26 Dec 22 11:32 src/
…

Although compiler warns that output filename was ignored, only the link target ignores it. All other targets generate file with provided output filename.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-driverArea: rustc_driver that ties everything together into the `rustc` compilerE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.rust-2-breakage-wishlistIn the wishlist of breaking changes that requires rust 2.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions