about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 624b5854b5f..3031ce6685a 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -53,7 +53,7 @@ extern "C" bool LLVMLinkModules(LLVMModuleRef Dest, LLVMModuleRef Src) {
   // function" error.
   Module *DM = reinterpret_cast<Module *>(Dest);
   Module *SM = reinterpret_cast<Module *>(Src);
-  if (Linker::LinkModules(DM, SM, &err)) {
+  if (Linker::LinkModules(DM, SM, Linker::DestroySource, &err)) {
     LLVMRustError = err.c_str();
     return false;
   }