Skip to content

Commit

Permalink
Merge pull request #7012 from roc-lang/stoud-flush-fix
Browse files Browse the repository at this point in the history
flush write_all
  • Loading branch information
Anton-4 committed Aug 20, 2024
2 parents 7c7485b + 8f9d414 commit cb804b9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/platform-switching/rust-platform/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit cb804b9

Please sign in to comment.