At present, rustc --emit=metadata foo.rs generates an empty rmeta file named libfoo.rmeta. The logic behind is that rmeta is not needed for certain crate types. However, I feel we should still save it to a file when user explicitly requested it by --emit=metadata, especially the metadata is always available in memory regardless of output crate types.