From 4004b7393b20a610982477cfbc11d6d965af77a6 Mon Sep 17 00:00:00 2001 From: JacobLinCool Date: Tue, 24 Sep 2024 23:03:19 +0800 Subject: [PATCH] feat: print stderr for rust compiler --- src/compilers/rs.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/compilers/rs.rs b/src/compilers/rs.rs index 5e896ec..2e80491 100644 --- a/src/compilers/rs.rs +++ b/src/compilers/rs.rs @@ -30,7 +30,12 @@ impl Compiler for RsCompiler { fn describe(&self) -> String { let version_output = Command::new(COMPILE_COMMAND).arg("--version").output(); let version = match version_output { - Ok(output) => String::from_utf8_lossy(&output.stdout).to_string(), + Ok(output) => { + if !output.stderr.is_empty() { + eprintln!("{}", String::from_utf8_lossy(&output.stderr)); + } + String::from_utf8_lossy(&output.stdout).to_string() + } Err(_) => String::from("unknown"), };