mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
21 lines
270 B
Rust
21 lines
270 B
Rust
//@ 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");
|
|
});
|
|
}
|