Port stdout-during-shutdown
This commit is contained in:
parent
70147cd3ab
commit
7a906e1af7
@ -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.
|
20
tests/ui/runtime/stdout-during-shutdown-windows.rs
Normal file
20
tests/ui/runtime/stdout-during-shutdown-windows.rs
Normal 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");
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
hello, world!
|
Loading…
x
Reference in New Issue
Block a user