Open
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?