Port stdout-during-shutdown

This commit is contained in:
Ben Kimock 2024-04-18 17:49:07 -04:00
parent 70147cd3ab
commit 7a906e1af7
4 changed files with 22 additions and 0 deletions

View File

@ -1,6 +1,7 @@
//@ run-pass //@ run-pass
//@ check-run-results //@ check-run-results
//@ ignore-emscripten //@ ignore-emscripten
//@ only-unix
// Emscripten doesn't flush its own stdout buffers on exit, which would fail // Emscripten doesn't flush its own stdout buffers on exit, which would fail
// this test. So this test is disabled on this platform. // this test. So this test is disabled on this platform.

View File

@ -0,0 +1,20 @@
//@ run-pass
//@ check-run-results
//@ only-windows
struct Bye;
impl Drop for Bye {
fn drop(&mut self) {
print!(", world!");
}
}
fn main() {
thread_local!{
static BYE: Bye = Bye;
}
BYE.with(|_| {
print!("hello");
});
}

View File

@ -0,0 +1 @@
hello, world!