diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-11-16 13:39:56 +0200 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-11-16 15:08:18 +0200 |
| commit | d1410ada92bfc80f4e7020336e182670084acd0e (patch) | |
| tree | 415da9e0a10162e91a854e00b50621ea8bedda30 /src/librustc_codegen_llvm | |
| parent | 47c84c4234a6e3ee24888bd94daeec13df7dd20d (diff) | |
| download | rust-d1410ada92bfc80f4e7020336e182670084acd0e.tar.gz rust-d1410ada92bfc80f4e7020336e182670084acd0e.zip | |
[eddyb] rustc_codegen_ssa: avoid a `Clone` bound on `TargetMachine`.
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/back/lto.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/lib.rs | 11 |
2 files changed, 1 insertions, 12 deletions
diff --git a/src/librustc_codegen_llvm/back/lto.rs b/src/librustc_codegen_llvm/back/lto.rs index a5f07e46e11..2fc8deeec8a 100644 --- a/src/librustc_codegen_llvm/back/lto.rs +++ b/src/librustc_codegen_llvm/back/lto.rs @@ -649,7 +649,7 @@ pub unsafe fn optimize_thin_module( timeline: &mut Timeline ) -> Result<ModuleCodegen<ModuleLlvm>, FatalError> { let diag_handler = cgcx.create_diag_handler(); - let tm = (cgcx.tm_factory)().map_err(|e| { + let tm = (cgcx.tm_factory.0)().map_err(|e| { write::llvm_err(&diag_handler, &e) })?; diff --git a/src/librustc_codegen_llvm/lib.rs b/src/librustc_codegen_llvm/lib.rs index 29bc3becd7e..9d569a4e28c 100644 --- a/src/librustc_codegen_llvm/lib.rs +++ b/src/librustc_codegen_llvm/lib.rs @@ -165,17 +165,6 @@ impl ExtraBackendMethods for LlvmCodegenBackend { } } -impl Clone for &'static mut llvm::TargetMachine { - fn clone(&self) -> Self { - // This method should never be called. It is put here because in - // rustc_codegen_ssa::back::write::CodegenContext, the TargetMachine is contained in a - // closure returned by a function under an Arc. The clone-deriving algorithm works when the - // struct contains the original LLVM TargetMachine type but not any more when supplied with - // a generic type. Hence this dummy Clone implementation. - panic!() - } -} - impl WriteBackendMethods for LlvmCodegenBackend { type Module = ModuleLlvm; type ModuleBuffer = back::lto::ModuleBuffer; |
