Skip to content

Commit 4711051

Browse files
authored
Rollup merge of rust-lang#60270 - alexcrichton:metadata-multi-cgu, r=oli-obk
rustc: Flag metadata compatible with multiple CGUs It looks like the `OutputType::Metadata` kind in the compiler was misclassified in rust-lang#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!
2 parents 95abeb0 + 955f283 commit 4711051

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
@@ -155,13 +155,12 @@ impl_stable_hash_via_hash!(OutputType);
155155
impl OutputType {
156156
fn is_compatible_with_codegen_units_and_single_output_file(&self) -> bool {
157157
match *self {
158-
OutputType::Exe | OutputType::DepInfo => true,
158+
OutputType::Exe | OutputType::DepInfo | OutputType::Metadata => true,
159159
OutputType::Bitcode
160160
| OutputType::Assembly
161161
| OutputType::LlvmAssembly
162162
| OutputType::Mir
163-
| OutputType::Object
164-
| OutputType::Metadata => false,
163+
| OutputType::Object => false,
165164
}
166165
}
167166

0 commit comments

Comments
 (0)