-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-driverArea: rustc_driver that ties everything together into the `rustc` compilerArea: rustc_driver that ties everything together into the `rustc` compilerC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
In order to only check if a program is well-formed (think cargo check
), one would like to call rustc
without emitting any files. cargo check
uses --emit=metadata -Z no-codegen
because the metadata is needed to check dependent crates.
However, it seems like it's impossible to tell the compiler to not write any files in the case of --crate-type=lib
. For the default --crate-type=bin
it works: rustc -Z no-codegen foo.rs
does not emit any files. But again, for rustc -Z no-codegen --crate-type=lib foo.rs
it emits an .rlib
file.
In case this isn't a bug, would it be possible to add an --emit=nothing
or equivalent option?
leonardo-m, resolritter, dtolnay, taiki-e, trevyn and 2 more
Metadata
Metadata
Assignees
Labels
A-driverArea: rustc_driver that ties everything together into the `rustc` compilerArea: rustc_driver that ties everything together into the `rustc` compilerC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.