Skip to content

migrate task_executor crate to Rust 2024 Edition#22688

Merged
tdyas merged 4 commits intomainfrom
rust/2024/task_executor
Sep 24, 2025
Merged

migrate task_executor crate to Rust 2024 Edition#22688
tdyas merged 4 commits intomainfrom
rust/2024/task_executor

Conversation

@tdyas
Copy link
Copy Markdown
Contributor

@tdyas tdyas commented Sep 21, 2025

Migrate the task_executor crate to Rust 2024 Edition.

The signature of task_executor::Executor::spawn_blocking was causing errors due to changes in the 2024 Edition around how lifetimes are captured for return-position impl Traits. Since spawn_blocking called the existing native_spawn_blocking method in its implementation, it was easier to just migrate all callers to native_spawn_blocking which didn't have issues due to the edition change.

Finally, spawn_blocking could then be replaced entirely by native_spawn_blocking (which is renamed to spawn_blocking).

The main resulting change is that callers now have to account for the JoinError when await'ing the JoinHandle returned by native_spawn_blocking (e.g., with a map_err(...) instead of passing a second argument to spawn_blocking to do an implied map_err.

@tdyas tdyas requested review from benjyw and sureshjoshi September 21, 2025 23:23
@tdyas tdyas added category:internal CI, fixes for not-yet-released features, etc. release-notes:not-required [CI] PR doesn't require mention in release notes labels Sep 21, 2025
Comment thread src/rust/task_executor/src/lib.rs Outdated
@tdyas tdyas force-pushed the rust/2024/task_executor branch from ddb08b1 to 7babb14 Compare September 24, 2025 03:30
@tdyas tdyas enabled auto-merge (squash) September 24, 2025 03:56
@tdyas tdyas merged commit c4b15eb into main Sep 24, 2025
24 checks passed
@tdyas tdyas deleted the rust/2024/task_executor branch September 24, 2025 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:internal CI, fixes for not-yet-released features, etc. release-notes:not-required [CI] PR doesn't require mention in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants