- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Closed
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.F-track_caller`#![feature(track_caller)]``#![feature(track_caller)]`
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)
Hocuri, Demindiro, lukechu10, shepmaster, Inky-developer and 1 moreelichai, rebo, TimDiekmann, WCarrollSTO, Hocuri and 1 more
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.F-track_caller`#![feature(track_caller)]``#![feature(track_caller)]`