From abdd24a0404e2ce7c879297da4aa66cf4e64ab79 Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Sat, 26 Jun 2021 19:30:09 +0200 Subject: Remove dropping of loaded plugins and better debug info --- compiler/rustc_codegen_llvm/src/llvm_util.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_codegen_llvm') diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs index 52d88df5b3f..cb9c6269b66 100644 --- a/compiler/rustc_codegen_llvm/src/llvm_util.rs +++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs @@ -12,6 +12,7 @@ use rustc_target::spec::{MergeFunctions, PanicStrategy}; use std::ffi::{CStr, CString}; use tracing::debug; +use std::mem; use std::path::Path; use std::ptr; use std::slice; @@ -136,9 +137,10 @@ unsafe fn configure_llvm(sess: &Session) { let path = Path::new(plugin); let res = DynamicLibrary::open(path); match res { - Ok(_) => debug!("configure_llvm: {}", plugin), + Ok(_) => debug!("LLVM plugin loaded succesfully {} ({})", path.display(), plugin), Err(e) => bug!("couldn't load plugin: {}", e), } + mem::forget(res); } rustc_llvm::initialize_available_targets(); -- cgit 1.4.1-3-g733a5