Merge pull request #7012 from roc-lang/stoud-flush-fix

flush write_all
This commit is contained in:
Anton-4 2024-08-20 13:55:07 +02:00 committed by GitHub
commit cb804b9975
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -93,6 +93,11 @@ pub extern "C" fn rust_main() -> i32 {
panic!("Writing to stdout failed! {:?}", e);
}
// roc_str will not print without flushing if it does not contain a newline and you're using --linker=legacy
if let Err(e) = std::io::stdout().flush() {
panic!("Failed to flush stdout: {:?}", e);
}
// Exit code
0
}