diff options
| author | bors <bors@rust-lang.org> | 2019-03-29 05:00:58 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-03-29 05:00:58 +0000 |
| commit | 4fec737f9aad565ef0351c38f147b78394b7a8ac (patch) | |
| tree | dc86fbe608d09c12a68c285b86d247db3a2f1c16 /src/librustc_codegen_ssa | |
| parent | 70a497a43794f0da5610c6da835ed3e02cd9af4d (diff) | |
| parent | 8d4afbe4136933b47082dd1efa9c1132a31dfb0d (diff) | |
| download | rust-4fec737f9aad565ef0351c38f147b78394b7a8ac.tar.gz rust-4fec737f9aad565ef0351c38f147b78394b7a8ac.zip | |
Auto merge of #58605 - nagisa:fix-the-metadata, r=michaelwoerister
Use informational target machine for metadata Since there is nothing to optimise there... Should fix #58323 but haven’t tested locally. r? @michaelwoerister
Diffstat (limited to 'src/librustc_codegen_ssa')
| -rw-r--r-- | src/librustc_codegen_ssa/back/write.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/librustc_codegen_ssa/back/write.rs b/src/librustc_codegen_ssa/back/write.rs index 859dfb99d92..55b7855ac08 100644 --- a/src/librustc_codegen_ssa/back/write.rs +++ b/src/librustc_codegen_ssa/back/write.rs @@ -1075,7 +1075,13 @@ fn start_executing_work<B: ExtraBackendMethods>( None }; - let ol = tcx.backend_optimization_level(LOCAL_CRATE); + let ol = if tcx.sess.opts.debugging_opts.no_codegen + || !tcx.sess.opts.output_types.should_codegen() { + // If we know that we won’t be doing codegen, create target machines without optimisation. + config::OptLevel::No + } else { + tcx.backend_optimization_level(LOCAL_CRATE) + }; let cgcx = CodegenContext::<B> { backend: backend.clone(), crate_types: sess.crate_types.borrow().clone(), |
