Closed
Description
One problem I have is that it's not possible to put #[track_caller]
on closures, this is really useful when thread_local
is involved because then there's a lot of logic in closures that you might want to propagate
ie
thread_local! {static DONE: bool = false;}
#[track_caller]
fn assert_done() {
DONE.with(
#[track_caller]
|b| assert!(b),
);
}
fn main() {
assert_done();
}
Originally posted by @elichai in #47809 (comment)