Add #[track_caller] to gpui foreground executor spawn methods (#24103)

Use of this location info was added in #21758 to help with diagnosing
remote_server panics on drop of tasks on a different thread.

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-02-02 12:20:17 -07:00 committed by GitHub
parent 422d57e8a2
commit 691de6b4b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 7 additions and 0 deletions

View file

@ -172,6 +172,7 @@ impl AsyncApp {
}
/// Schedule a future to be polled in the background.
#[track_caller]
pub fn spawn<Fut, R>(&self, f: impl FnOnce(AsyncApp) -> Fut) -> Task<R>
where
Fut: Future<Output = R> + 'static,
@ -297,6 +298,7 @@ impl AsyncWindowContext {
/// Schedule a future to be executed on the main thread. This is used for collecting
/// the results of background tasks and updating the UI.
#[track_caller]
pub fn spawn<Fut, R>(&self, f: impl FnOnce(AsyncWindowContext) -> Fut) -> Task<R>
where
Fut: Future<Output = R> + 'static,