-
-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
The following test case fails with a SIGSEGV, due to a use after drop on a local variable:
#[test]
fn use_after_drop() {
let mut global = String::new();
let thread = make_worker_thread();
{
let local = String::from("test");
std::thread::scope(|s| {
drop(s.spawn_into(
|| {
std::thread::sleep(std::time::Duration::from_secs(1));
global = local.clone();
},
&thread,
));
});
}
thread.join();
assert_eq!(global, "test");
}Metadata
Metadata
Assignees
Labels
No labels