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(Dest); Module *SM = reinterpret_cast(Src); - if (Linker::LinkModules(DM, SM, &err)) { + if (Linker::LinkModules(DM, SM, Linker::DestroySource, &err)) { LLVMRustError = err.c_str(); return false; }