Skip to content

Commit 00cff28

Browse files
committed
sqlx_core::rt::timeout: box futures in debug mode
1 parent 80a6142 commit 00cff28

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

sqlx-core/src/rt/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ pub enum JoinHandle<T> {
2424
}
2525

2626
pub async fn timeout<F: Future>(duration: Duration, f: F) -> Result<F::Output, TimeoutError> {
27+
// Box futures in debug mode to decrease stack size
28+
#[cfg(debug_assertions)]
29+
let f = Box::pin(f);
30+
2731
#[cfg(feature = "_rt-tokio")]
2832
if rt_tokio::available() {
2933
return tokio::time::timeout(duration, f)

0 commit comments

Comments
 (0)