Skip to content

Commit 955f283

Browse files
committed
rustc: Flag metadata compatible with multiple CGUs
It looks like the `OutputType::Metadata` kind in the compiler was misclassified in #38571 long ago by accident as incompatible with codegen units and a single output file. This means that if you emit both a linkable artifact and metadata it silently turns off multiple codegen units unintentionally! This commit corrects the situation to ensure that if `--emit metadata` is used it doesn't implicitly disable multiple codegen units. This will ensure we don't accidentally regress compiler performance when striving to implement pipelined compilation!
1 parent 112f7e9 commit 955f283

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/librustc/session/config.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,12 @@ impl_stable_hash_via_hash!(OutputType);
153153
impl OutputType {
154154
fn is_compatible_with_codegen_units_and_single_output_file(&self) -> bool {
155155
match *self {
156-
OutputType::Exe | OutputType::DepInfo => true,
156+
OutputType::Exe | OutputType::DepInfo | OutputType::Metadata => true,
157157
OutputType::Bitcode
158158
| OutputType::Assembly
159159
| OutputType::LlvmAssembly
160160
| OutputType::Mir
161-
| OutputType::Object
162-
| OutputType::Metadata => false,
161+
| OutputType::Object => false,
163162
}
164163
}
165164

0 commit comments

Comments
 (0)