Closed
Description
This was uncovered in #75172 / #78227.
struct PanicInDrop;
impl Drop for PanicInDrop {
fn drop(&mut self) { panic!("💥"); }
}
thread_local!(static X: PanicInDrop = PanicInDrop);
fn main() {
X.with(|_| ());
}
This fails with:
thread 'main' panicked at '💥', src/main.rs:4:26
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
[-]Panicking in Drop of thread_local abort()s in #[test][/-][+]Panicking in Drop of thread_local gives fatal runtime error[/+]m-ou-se commentedon Oct 26, 2020
Closing as duplicate of #24479.