Skip to content

Commit cb96092

Browse files
authored
Trying idea from AbdouSeck
Application of rust-lang#424 (comment)
1 parent 73e848e commit cb96092

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/exercise.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ path = "{}.rs""#,
126126
.expect("Failed to run 'compile' command.");
127127

128128
if cmd.status.success() {
129+
// Because compiler warnings go to the standard error, we have to inspect the
130+
// standard error of the child process responsible for compiling the code.
131+
if !cmd.stderr.is_empty() {
132+
println!("{}", String::from_utf8_lossy(&cmd.stderr).to_string());
133+
//fs::write!(format!("[DEBUG] {}\n", String::from_utf8_lossy(&cmd.stderr).to_string()));
134+
}
129135
Ok(CompiledExercise {
130136
exercise: &self,
131137
_handle: FileHandle,

0 commit comments

Comments
 (0)