rustc/tests/ui/threads-sendsync/child-outlives-parent.rs
2025-02-17 11:14:05 +01:00

13 lines
208 B
Rust

//@ run-pass
// Reported as issue #126, child leaks the string.
//@ needs-threads
use std::thread;
fn child2(_s: String) {}
pub fn main() {
let _x = thread::spawn(move || child2("hi".to_string()));
}