🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

tokio

Package Overview
Dependencies
Maintainers
1
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tokio - cargo Package Compare versions

Comparing version
1.52.1
to
1.52.2
+107
tests/rt_spawn_blocking.rs
#![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))]
use std::time::Duration;
use tokio::runtime::Builder;
use tokio::sync::mpsc;
use tokio::task::JoinSet;
#[test]
fn issue_8056_regression_test() {
type Senders = Vec<mpsc::Sender<()>>;
type Handles = JoinSet<()>;
fn make_writer() -> (Senders, Handles) {
let mut senders = vec![];
let mut handles = JoinSet::new();
for _ in 0..2 {
let (tx, mut rx) = mpsc::channel::<()>(1);
senders.push(tx);
handles.spawn_blocking(move || while rx.blocking_recv().is_some() {});
}
(senders, handles)
}
async fn drive_writer(senders: Senders, mut handles: Handles) {
for tx in &senders {
tx.send(()).await.unwrap();
}
drop(senders);
while let Some(res) = handles.join_next().await {
res.unwrap();
}
}
// Regression test for the lost-spawn race in the blocking pool introduced
// by #7757. See https://github.com/tokio-rs/tokio/issues/8056 for complete
// details.
//
// The bug was a race condition in `Spawner::spawn_task` - after pushing a
// task to the queue, it chose between "wake an idle worker" and "spawn a
// new worker", by reading the `num_idle_threads` `AtomicUsize`. The
// `num_idle_threads` counter was incremented by a worker before it calls
// `wait_for_task`, and was deremented after `Inner::run` after
// `wait_for_task` had already returned a `Task`.
//
// In that window, the counter indicates a worker is idle even though it
// has already claimed a notification and is about to run a task. In the
// the omnicron test case that reproduced this, this task was long lived,
// which would essential result in "under spawning" workers.
//
// This test attempts to reproduce that scenario by doing the following on
// a fresh runtime
// - Two awaited `spawn_blocking` calls to get pool workers cycling through
// idle → notified → busy transitions.
// - `make_writer` spawns two closures that park in
// `mpsc::Receiver::blocking_recv` — long-lived blocking tasks that turn
// a stranded spawn into a real deadlock instead of a transient stall.
// - Two more rounds of "create a writer and immediately drop it" churn the
// worker pool while those persistent tasks are still blocked, and then a
// second persistent writer is created — this `spawn_blocking` is most
// likely to trigger the bug, because the prior churn has left a worker
// mid-transition with a stale `num_idle_threads`.
// - Finally, we finish all the tasks -- if any of them never got pulled
// from the `spawn_blocking` queue then it hits the timeout.
// Run multiple times to make hitting the race condition very likely.
for _ in 0..512 {
let rt = Builder::new_current_thread().enable_all().build().unwrap();
let completed = rt.block_on(async {
// We use a timeout to turn a hang into a reliable (and fast)
// failure. On working code this needs like a millisecond, so any
// timeout will do.
tokio::time::timeout(Duration::from_secs(1), async {
let quick = || async {
tokio::task::spawn_blocking(|| {}).await.unwrap();
};
quick().await;
quick().await;
let (persistent_senders, persistent_handles) = make_writer();
for _ in 0..2 {
quick().await;
quick().await;
let (senders, mut handles) = make_writer();
drop(senders);
while let Some(res) = handles.join_next().await {
res.unwrap();
}
}
quick().await;
quick().await;
let (second_senders, second_handles) = make_writer();
drive_writer(persistent_senders, persistent_handles).await;
drive_writer(second_senders, second_handles).await;
})
.await
.is_ok()
});
assert!(completed);
}
}
+1
-1
{
"git": {
"sha1": "8f89d93eb477681f66c4b83880e3313e94d3da40"
"sha1": "4abe9d732eb01f7b092a571c3dcc4fbd266f4067"
},
"path_in_vcs": "tokio"
}
+409
-290

@@ -22,5 +22,5 @@ # This file is automatically @generated by Cargo.

name = "aho-corasick"
version = "1.1.3"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
dependencies = [

@@ -32,7 +32,13 @@ "memchr",

name = "anstyle"
version = "1.0.13"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78"
checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000"
[[package]]
name = "anyhow"
version = "1.0.102"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
[[package]]
name = "async-stream"

@@ -60,2 +66,13 @@ version = "0.3.6"

[[package]]
name = "async-trait"
version = "0.1.89"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "autocfg"

@@ -78,3 +95,3 @@ version = "1.5.0"

"rustc-demangle",
"windows-link 0.2.1",
"windows-link",
]

@@ -99,23 +116,29 @@

name = "bitflags"
version = "2.10.0"
version = "2.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
checksum = "c4512299f36f043ab09a583e57bceb5a5aab7a73db1805848e8fef3c9e8c78b3"
[[package]]
name = "bumpalo"
version = "3.19.0"
version = "3.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43"
checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb"
[[package]]
name = "bytes"
version = "1.10.1"
version = "1.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33"
[[package]]
name = "cast"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
[[package]]
name = "cc"
version = "1.2.41"
version = "1.2.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac9fe6cdbb24b6ade63616c0a0688e45bb56732262c158df3c0c4bea4ca47cb7"
checksum = "d16d90359e986641506914ba71350897565610e87ce0ad9e6f28569db3dd5c6d"
dependencies = [

@@ -139,24 +162,14 @@ "find-msvc-tools",

[[package]]
name = "cordyceps"
version = "0.3.4"
name = "downcast"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "688d7fbb8092b8de775ef2536f36c8c31f2bc4006ece2e8d8ad2d17d00ce0a2a"
dependencies = [
"loom",
"tracing",
]
checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1"
[[package]]
name = "diatomic-waker"
version = "0.2.3"
name = "equivalent"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab03c107fafeb3ee9f5925686dbb7a73bc76e3932abb0d2b365cb64b169cf04c"
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
[[package]]
name = "downcast"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1"
[[package]]
name = "errno"

@@ -173,11 +186,11 @@ version = "0.3.14"

name = "fastrand"
version = "2.3.0"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6"
[[package]]
name = "find-msvc-tools"
version = "0.1.4"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127"
checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"

@@ -197,12 +210,21 @@ [[package]]

[[package]]
name = "foldhash"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
[[package]]
name = "fragile"
version = "2.0.1"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619"
checksum = "8878864ba14bb86e818a412bfd6f18f9eabd4ec0f008a28e8f7eb61db532fcf9"
dependencies = [
"futures-core",
]
[[package]]
name = "futures"
version = "0.3.31"
version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876"
checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d"
dependencies = [

@@ -219,19 +241,6 @@ "futures-channel",

[[package]]
name = "futures-buffered"
version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8e0e1f38ec07ba4abbde21eed377082f17ccb988be9d988a5adbf4bafc118fd"
dependencies = [
"cordyceps",
"diatomic-waker",
"futures-core",
"pin-project-lite",
"spin",
]
[[package]]
name = "futures-channel"
version = "0.3.31"
version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d"
dependencies = [

@@ -244,12 +253,10 @@ "futures-core",

name = "futures-concurrency"
version = "7.6.3"
version = "7.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eb68017df91f2e477ed4bea586c59eaecaa47ed885a770d0444e21e62572cd2"
checksum = "175cd8cca9e1d45b87f18ffa75088f2099e3c4fe5e2f83e42de112560bea8ea6"
dependencies = [
"fixedbitset",
"futures-buffered",
"futures-core",
"futures-lite",
"pin-project",
"slab",
"smallvec",

@@ -260,11 +267,11 @@ ]

name = "futures-core"
version = "0.3.31"
version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d"
[[package]]
name = "futures-executor"
version = "0.3.31"
version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f"
checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d"
dependencies = [

@@ -278,5 +285,5 @@ "futures-core",

name = "futures-io"
version = "0.3.31"
version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718"

@@ -298,5 +305,5 @@ [[package]]

name = "futures-macro"
version = "0.3.31"
version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650"
checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b"
dependencies = [

@@ -310,17 +317,17 @@ "proc-macro2",

name = "futures-sink"
version = "0.3.31"
version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893"
[[package]]
name = "futures-task"
version = "0.3.31"
version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393"
[[package]]
name = "futures-test"
version = "0.3.31"
version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5961fb6311645f46e2cdc2964a8bfae6743fd72315eaec181a71ae3eb2467113"
checksum = "32d24b40cb9018c6b0f9d891b74a86a777d5db37972a115016d1150257b1c793"
dependencies = [

@@ -339,5 +346,5 @@ "futures-core",

name = "futures-util"
version = "0.3.31"
version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6"
dependencies = [

@@ -352,3 +359,2 @@ "futures-channel",

"pin-project-lite",
"pin-utils",
"slab",

@@ -359,5 +365,5 @@ ]

name = "generator"
version = "0.8.7"
version = "0.8.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "605183a538e3e2a9c1038635cc5c2d194e2ee8fd0d1b66b8349fad7dbacce5a2"
checksum = "52f04ae4152da20c76fe800fa48659201d5cf627c5149ca0b707b69d7eef6cf9"
dependencies = [

@@ -369,3 +375,4 @@ "cc",

"rustversion",
"windows",
"windows-link",
"windows-result",
]

@@ -381,3 +388,3 @@

"libc",
"r-efi",
"r-efi 5.3.0",
"wasip2",

@@ -387,2 +394,15 @@ ]

[[package]]
name = "getrandom"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555"
dependencies = [
"cfg-if",
"libc",
"r-efi 6.0.0",
"wasip2",
"wasip3",
]
[[package]]
name = "gimli"

@@ -394,6 +414,45 @@ version = "0.32.3"

[[package]]
name = "hashbrown"
version = "0.15.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
dependencies = [
"foldhash",
]
[[package]]
name = "hashbrown"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51"
[[package]]
name = "heck"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "id-arena"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954"
[[package]]
name = "indexmap"
version = "2.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9"
dependencies = [
"equivalent",
"hashbrown 0.17.0",
"serde",
"serde_core",
]
[[package]]
name = "io-uring"
version = "0.7.11"
version = "0.7.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fdd7bddefd0a8833b88a4b68f90dae22c7450d11b354198baee3874fd811b344"
checksum = "4d09b98f7eace8982db770e4408e7470b028ce513ac28fecdc6bf4c30fe92b62"
dependencies = [

@@ -407,12 +466,14 @@ "bitflags",

name = "itoa"
version = "1.0.15"
version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
[[package]]
name = "js-sys"
version = "0.3.81"
version = "0.3.97"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec48937a97411dcb524a265206ccd4c90bb711fca92b2792c407f268825b9305"
checksum = "a1840c94c045fbcf8ba2812c95db44499f7c64910a912551aaaa541decebcacf"
dependencies = [
"cfg-if",
"futures-util",
"once_cell",

@@ -429,12 +490,24 @@ "wasm-bindgen",

[[package]]
name = "leb128fmt"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
[[package]]
name = "libc"
version = "0.2.184"
version = "0.2.186"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af"
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
[[package]]
name = "libm"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
[[package]]
name = "linux-raw-sys"
version = "0.11.0"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"

@@ -452,5 +525,5 @@ [[package]]

name = "log"
version = "0.4.28"
version = "0.4.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"

@@ -484,5 +557,5 @@ [[package]]

name = "memchr"
version = "2.7.6"
version = "2.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79"

@@ -500,5 +573,5 @@ [[package]]

name = "minicov"
version = "0.3.7"
version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f27fe9f1cc3c22e1687f9446c2083c4c5fc7f0bcf1c7a86bdbded14985895b4b"
checksum = "4869b6a491569605d66d3952bcdf03df789e5b536e5f0cf7758a7f08a55ae24d"
dependencies = [

@@ -597,2 +670,3 @@ "cc",

"autocfg",
"libm",
]

@@ -611,7 +685,13 @@

name = "once_cell"
version = "1.21.3"
version = "1.21.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
[[package]]
name = "oorandom"
version = "11.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e"
[[package]]
name = "parking"

@@ -642,3 +722,3 @@ version = "2.2.1"

"smallvec",
"windows-link 0.2.1",
"windows-link",
]

@@ -648,5 +728,5 @@

name = "pin-project"
version = "1.1.10"
version = "1.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a"
checksum = "f1749c7ed4bcaf4c3d0a3efc28538844fb29bcdd7d2b67b2be7e20ba861ff517"
dependencies = [

@@ -658,5 +738,5 @@ "pin-project-internal",

name = "pin-project-internal"
version = "1.1.10"
version = "1.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861"
checksum = "d9b20ed30f105399776b9c883e68e536ef602a16ae6f596d2c473591d6ad64c6"
dependencies = [

@@ -670,5 +750,5 @@ "proc-macro2",

name = "pin-project-lite"
version = "0.2.16"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"

@@ -692,5 +772,5 @@ [[package]]

name = "predicates"
version = "3.1.3"
version = "3.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573"
checksum = "ada8f2932f28a27ee7b70dd6c1c39ea0675c55a36879ab92f3a715eaa1e63cfe"
dependencies = [

@@ -703,11 +783,11 @@ "anstyle",

name = "predicates-core"
version = "1.0.9"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa"
checksum = "cad38746f3166b4031b1a0d39ad9f954dd291e7854fcc0eed52ee41a0b50d144"
[[package]]
name = "predicates-tree"
version = "1.0.12"
version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c"
checksum = "d0de1b847b39c8131db0467e9df1ff60e6d0562ab8e9a16e568ad0fdb372e2f2"
dependencies = [

@@ -719,6 +799,16 @@ "predicates-core",

[[package]]
name = "prettyplease"
version = "0.2.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
dependencies = [
"proc-macro2",
"syn",
]
[[package]]
name = "proc-macro2"
version = "1.0.101"
version = "1.0.106"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de"
checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
dependencies = [

@@ -730,5 +820,5 @@ "unicode-ident",

name = "proptest"
version = "1.8.0"
version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bb0be07becd10686a0bb407298fb425360a5c44a663774406340c59a22de4ce"
checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744"
dependencies = [

@@ -738,3 +828,2 @@ "bit-set",

"bitflags",
"lazy_static",
"num-traits",

@@ -758,5 +847,5 @@ "rand",

name = "quote"
version = "1.0.41"
version = "1.0.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1"
checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924"
dependencies = [

@@ -773,6 +862,12 @@ "proc-macro2",

[[package]]
name = "r-efi"
version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
[[package]]
name = "rand"
version = "0.9.2"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea"
dependencies = [

@@ -795,7 +890,7 @@ "rand_chacha",

name = "rand_core"
version = "0.9.3"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c"
dependencies = [
"getrandom",
"getrandom 0.3.4",
]

@@ -823,5 +918,5 @@

name = "regex-automata"
version = "0.4.13"
version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c"
checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f"
dependencies = [

@@ -835,17 +930,17 @@ "aho-corasick",

name = "regex-syntax"
version = "0.8.8"
version = "0.8.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58"
checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a"
[[package]]
name = "rustc-demangle"
version = "0.1.26"
version = "0.1.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace"
checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d"
[[package]]
name = "rustix"
version = "1.1.2"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e"
checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"
dependencies = [

@@ -878,8 +973,2 @@ "bitflags",

[[package]]
name = "ryu"
version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
[[package]]
name = "same-file"

@@ -906,2 +995,8 @@ version = "1.0.6"

[[package]]
name = "semver"
version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"
[[package]]
name = "serde"

@@ -938,11 +1033,11 @@ version = "1.0.228"

name = "serde_json"
version = "1.0.145"
version = "1.0.149"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c"
checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
dependencies = [
"itoa",
"memchr",
"ryu",
"serde",
"serde_core",
"zmij",
]

@@ -967,6 +1062,7 @@

name = "signal-hook-registry"
version = "1.4.6"
version = "1.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b"
checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
dependencies = [
"errno",
"libc",

@@ -977,5 +1073,5 @@ ]

name = "slab"
version = "0.4.11"
version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589"
checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"

@@ -999,12 +1095,6 @@ [[package]]

[[package]]
name = "spin"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5fe4ccb98d9c292d56fec89a5e07da7fc4cf0dc11e156b41793132775d3e591"
[[package]]
name = "syn"
version = "2.0.107"
version = "2.0.117"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a26dbd934e5451d21ef060c018dae56fc073894c5a7896f882928a76e6d081b"
checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99"
dependencies = [

@@ -1018,8 +1108,8 @@ "proc-macro2",

name = "tempfile"
version = "3.23.0"
version = "3.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16"
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
dependencies = [
"fastrand",
"getrandom",
"getrandom 0.4.2",
"once_cell",

@@ -1047,5 +1137,5 @@ "rustix",

name = "tokio"
version = "1.52.0"
version = "1.52.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a91135f59b1cbf38c91e73cf3386fca9bb77915c45ce2771460c9d92f0f3d776"
checksum = "b67dee974fe86fd92cc45b7a95fdd2f99a36a6d7b0d431a231178d3d670bbcc6"
dependencies = [

@@ -1057,3 +1147,3 @@ "pin-project-lite",

name = "tokio"
version = "1.52.1"
version = "1.52.2"
dependencies = [

@@ -1110,3 +1200,3 @@ "async-stream",

"pin-project-lite",
"tokio 1.52.0",
"tokio 1.52.1",
]

@@ -1121,3 +1211,3 @@

"futures-core",
"tokio 1.52.0",
"tokio 1.52.1",
"tokio-stream",

@@ -1137,3 +1227,3 @@ ]

"pin-project-lite",
"tokio 1.52.0",
"tokio 1.52.1",
]

@@ -1143,5 +1233,5 @@

name = "tracing"
version = "0.1.41"
version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
dependencies = [

@@ -1155,5 +1245,5 @@ "pin-project-lite",

name = "tracing-attributes"
version = "0.1.30"
version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903"
checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
dependencies = [

@@ -1167,5 +1257,5 @@ "proc-macro2",

name = "tracing-core"
version = "0.1.34"
version = "0.1.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678"
checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
dependencies = [

@@ -1199,5 +1289,5 @@ "once_cell",

name = "tracing-subscriber"
version = "0.3.20"
version = "0.3.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5"
checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319"
dependencies = [

@@ -1224,7 +1314,13 @@ "matchers",

name = "unicode-ident"
version = "1.0.20"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "462eeb75aeb73aea900253ce739c8e18a67423fadf006037cd3ff27e82748a06"
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
[[package]]
name = "unicode-xid"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
[[package]]
name = "valuable"

@@ -1262,14 +1358,23 @@ version = "0.1.1"

name = "wasip2"
version = "1.0.1+wasi-0.2.4"
version = "1.0.3+wasi-0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7"
checksum = "20064672db26d7cdc89c7798c48a0fdfac8213434a1186e5ef29fd560ae223d6"
dependencies = [
"wit-bindgen",
"wit-bindgen 0.57.1",
]
[[package]]
name = "wasip3"
version = "0.4.0+wasi-0.3.0-rc-2026-01-06"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5"
dependencies = [
"wit-bindgen 0.51.0",
]
[[package]]
name = "wasm-bindgen"
version = "0.2.104"
version = "0.2.120"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d"
checksum = "df52b6d9b87e0c74c9edfa1eb2d9bf85e5d63515474513aa50fa181b3c4f5db1"
dependencies = [

@@ -1284,26 +1389,9 @@ "cfg-if",

[[package]]
name = "wasm-bindgen-backend"
version = "0.2.104"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "671c9a5a66f49d8a47345ab942e2cb93c7d1d0339065d4f8139c486121b43b19"
dependencies = [
"bumpalo",
"log",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-futures"
version = "0.4.54"
version = "0.4.70"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e038d41e478cc73bae0ff9b36c60cff1c98b8f38f8d7e8061e79ee63608ac5c"
checksum = "af934872acec734c2d80e6617bbb5ff4f12b052dd8e6332b0817bce889516084"
dependencies = [
"cfg-if",
"js-sys",
"once_cell",
"wasm-bindgen",
"web-sys",
]

@@ -1313,5 +1401,5 @@

name = "wasm-bindgen-macro"
version = "0.2.104"
version = "0.2.120"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119"
checksum = "78b1041f495fb322e64aca85f5756b2172e35cd459376e67f2a6c9dffcedb103"
dependencies = [

@@ -1324,10 +1412,10 @@ "quote",

name = "wasm-bindgen-macro-support"
version = "0.2.104"
version = "0.2.120"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7"
checksum = "9dcd0ff20416988a18ac686d4d4d0f6aae9ebf08a389ff5d29012b05af2a1b41"
dependencies = [
"bumpalo",
"proc-macro2",
"quote",
"syn",
"wasm-bindgen-backend",
"wasm-bindgen-shared",

@@ -1338,5 +1426,5 @@ ]

name = "wasm-bindgen-shared"
version = "0.2.104"
version = "0.2.120"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1"
checksum = "49757b3c82ebf16c57d69365a142940b384176c24df52a087fb748e2085359ea"
dependencies = [

@@ -1348,11 +1436,20 @@ "unicode-ident",

name = "wasm-bindgen-test"
version = "0.3.54"
version = "0.3.70"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e381134e148c1062f965a42ed1f5ee933eef2927c3f70d1812158f711d39865"
checksum = "29826f9d9ecaa314c480d376b276d1c790e6cb6a4681fab8532da69cbabf977d"
dependencies = [
"async-trait",
"cast",
"js-sys",
"libm",
"minicov",
"nu-ansi-term",
"num-traits",
"oorandom",
"serde",
"serde_json",
"wasm-bindgen",
"wasm-bindgen-futures",
"wasm-bindgen-test-macro",
"wasm-bindgen-test-shared",
]

@@ -1362,5 +1459,5 @@

name = "wasm-bindgen-test-macro"
version = "0.3.54"
version = "0.3.70"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b673bca3298fe582aeef8352330ecbad91849f85090805582400850f8270a2e8"
checksum = "c610311887f9e6599a546d278d12d69dfd3a3e92639b2129e4b11ad6cf1961d6"
dependencies = [

@@ -1373,157 +1470,173 @@ "proc-macro2",

[[package]]
name = "web-sys"
version = "0.3.81"
name = "wasm-bindgen-test-shared"
version = "0.2.120"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9367c417a924a74cae129e6a2ae3b47fabb1f8995595ab474029da749a8be120"
dependencies = [
"js-sys",
"wasm-bindgen",
]
checksum = "60238e5b4b1b295701d6f9a66d2a126fe19990348f5fb9dae3b623a370119d94"
[[package]]
name = "winapi-util"
version = "0.1.11"
name = "wasm-encoder"
version = "0.244.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319"
dependencies = [
"windows-sys",
"leb128fmt",
"wasmparser",
]
[[package]]
name = "windows"
version = "0.61.3"
name = "wasm-metadata"
version = "0.244.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893"
checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909"
dependencies = [
"windows-collections",
"windows-core",
"windows-future",
"windows-link 0.1.3",
"windows-numerics",
"anyhow",
"indexmap",
"wasm-encoder",
"wasmparser",
]
[[package]]
name = "windows-collections"
version = "0.2.0"
name = "wasmparser"
version = "0.244.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8"
checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe"
dependencies = [
"windows-core",
"bitflags",
"hashbrown 0.15.5",
"indexmap",
"semver",
]
[[package]]
name = "windows-core"
version = "0.61.2"
name = "winapi-util"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [
"windows-implement",
"windows-interface",
"windows-link 0.1.3",
"windows-result",
"windows-strings",
"windows-sys",
]
[[package]]
name = "windows-future"
name = "windows-link"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e"
dependencies = [
"windows-core",
"windows-link 0.1.3",
"windows-threading",
]
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
[[package]]
name = "windows-implement"
version = "0.60.2"
name = "windows-result"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf"
checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"
dependencies = [
"proc-macro2",
"quote",
"syn",
"windows-link",
]
[[package]]
name = "windows-interface"
version = "0.59.3"
name = "windows-sys"
version = "0.61.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358"
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
dependencies = [
"proc-macro2",
"quote",
"syn",
"windows-link",
]
[[package]]
name = "windows-link"
version = "0.1.3"
name = "wit-bindgen"
version = "0.51.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
dependencies = [
"wit-bindgen-rust-macro",
]
[[package]]
name = "windows-link"
version = "0.2.1"
name = "wit-bindgen"
version = "0.57.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"
[[package]]
name = "windows-numerics"
version = "0.2.0"
name = "wit-bindgen-core"
version = "0.51.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1"
checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc"
dependencies = [
"windows-core",
"windows-link 0.1.3",
"anyhow",
"heck",
"wit-parser",
]
[[package]]
name = "windows-result"
version = "0.3.4"
name = "wit-bindgen-rust"
version = "0.51.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6"
checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21"
dependencies = [
"windows-link 0.1.3",
"anyhow",
"heck",
"indexmap",
"prettyplease",
"syn",
"wasm-metadata",
"wit-bindgen-core",
"wit-component",
]
[[package]]
name = "windows-strings"
version = "0.4.2"
name = "wit-bindgen-rust-macro"
version = "0.51.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57"
checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a"
dependencies = [
"windows-link 0.1.3",
"anyhow",
"prettyplease",
"proc-macro2",
"quote",
"syn",
"wit-bindgen-core",
"wit-bindgen-rust",
]
[[package]]
name = "windows-sys"
version = "0.61.2"
name = "wit-component"
version = "0.244.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2"
dependencies = [
"windows-link 0.2.1",
"anyhow",
"bitflags",
"indexmap",
"log",
"serde",
"serde_derive",
"serde_json",
"wasm-encoder",
"wasm-metadata",
"wasmparser",
"wit-parser",
]
[[package]]
name = "windows-threading"
version = "0.1.0"
name = "wit-parser"
version = "0.244.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6"
checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736"
dependencies = [
"windows-link 0.1.3",
"anyhow",
"id-arena",
"indexmap",
"log",
"semver",
"serde",
"serde_derive",
"serde_json",
"unicode-xid",
"wasmparser",
]
[[package]]
name = "wit-bindgen"
version = "0.46.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59"
[[package]]
name = "zerocopy"
version = "0.8.27"
version = "0.8.48"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c"
checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9"
dependencies = [

@@ -1535,5 +1648,5 @@ "zerocopy-derive",

name = "zerocopy-derive"
version = "0.8.27"
version = "0.8.48"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831"
checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4"
dependencies = [

@@ -1544,1 +1657,7 @@ "proc-macro2",

]
[[package]]
name = "zmij"
version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"

@@ -16,3 +16,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO

name = "tokio"
version = "1.52.1"
version = "1.52.2"
authors = ["Tokio Contributors <team@tokio.rs>"]

@@ -517,2 +517,6 @@ build = false

[[test]]
name = "rt_spawn_blocking"
path = "tests/rt_spawn_blocking.rs"
[[test]]
name = "rt_threaded"

@@ -519,0 +523,0 @@ path = "tests/rt_threaded.rs"

@@ -63,3 +63,3 @@ *[TokioConf 2026 program and tickets are now available!](https://tokioconf.com)*

[dependencies]
tokio = { version = "1.52.1", features = ["full"] }
tokio = { version = "1.52.2", features = ["full"] }
```

@@ -66,0 +66,0 @@ Then, on your main.rs:

@@ -523,2 +523,16 @@ #![allow(unused_macros)]

))]
#[cfg_attr(
docsrs,
doc(cfg(all(
tokio_unstable,
feature = "taskdump",
feature = "rt",
target_os = "linux",
any(
target_arch = "aarch64",
target_arch = "x86",
target_arch = "x86_64"
)
)))
)]
$item

@@ -525,0 +539,0 @@ )*

@@ -620,2 +620,10 @@ //! Unix pipe types.

///
/// # Notes
///
/// To avoid unnecessary syscalls, this will only attempt the write
/// operation if the OS has informed Tokio that this pipe has become
/// writable. Because of this, `try_write()` may fail with a
/// [`WouldBlock`] error if Tokio has not yet heard from the OS that
/// this pipe has become writable.
///
/// # Examples

@@ -654,2 +662,4 @@ ///

/// ```
///
/// [`WouldBlock`]: std::io::ErrorKind::WouldBlock
pub fn try_write(&self, buf: &[u8]) -> io::Result<usize> {

@@ -686,2 +696,10 @@ self.io

///
/// # Notes
///
/// To avoid unnecessary syscalls, this will only attempt the write
/// operation if the OS has informed Tokio that this pipe has become
/// writable. Because of this, `try_write_vectored()` may fail with a
/// [`WouldBlock`] error if Tokio has not yet heard from the OS that
/// this pipe has become writable.
///
/// # Examples

@@ -722,2 +740,4 @@ ///

/// ```
///
/// [`WouldBlock`]: std::io::ErrorKind::WouldBlock
pub fn try_write_vectored(&self, buf: &[io::IoSlice<'_>]) -> io::Result<usize> {

@@ -1159,2 +1179,10 @@ self.io

///
/// # Notes
///
/// To avoid unnecessary syscalls, this will only attempt the read
/// operation if the OS has informed Tokio that this pipe has become
/// readable. Because of this, `try_read()` may fail with a
/// [`WouldBlock`] error if Tokio has not yet heard from the OS that
/// this pipe has become readable.
///
/// # Examples

@@ -1197,2 +1225,4 @@ ///

/// ```
///
/// [`WouldBlock`]: std::io::ErrorKind::WouldBlock
pub fn try_read(&self, buf: &mut [u8]) -> io::Result<usize> {

@@ -1229,2 +1259,10 @@ self.io

///
/// # Notes
///
/// To avoid unnecessary syscalls, this will only attempt the read
/// operation if the OS has informed Tokio that this pipe has become
/// readable. Because of this, `try_read_vectored()` may fail with a
/// [`WouldBlock`] error if Tokio has not yet heard from the OS that
/// this pipe has become readable.
///
/// # Examples

@@ -1273,2 +1311,4 @@ ///

/// ```
///
/// [`WouldBlock`]: std::io::ErrorKind::WouldBlock
pub fn try_read_vectored(&self, bufs: &mut [io::IoSliceMut<'_>]) -> io::Result<usize> {

@@ -1333,2 +1373,10 @@ self.io

///
/// # Notes
///
/// To avoid unnecessary syscalls, this will only attempt the read
/// operation if the OS has informed Tokio that this pipe has become
/// readable. Because of this, `try_read_buf()` may fail with a
/// [`WouldBlock`] error if Tokio has not yet heard from the OS that
/// this pipe has become readable.
///
/// # Examples

@@ -1370,2 +1418,4 @@ ///

/// ```
///
/// [`WouldBlock`]: std::io::ErrorKind::WouldBlock
pub fn try_read_buf<B: BufMut>(&self, buf: &mut B) -> io::Result<usize> {

@@ -1372,0 +1422,0 @@ self.io.registration().try_io(Interest::READABLE, || {

@@ -37,9 +37,7 @@ #![cfg_attr(

/// store the last scheduled task. This can improve certain usage patterns,
/// especially message passing between tasks.
/// especially message passing between tasks. However, this LIFO slot is not
/// currently stealable.
///
/// In Tokio versions before 1.51, tasks in the LIFO slot could not be
/// stolen, which could cause issues in applications with long poll times.
/// As a stop-gap, this unstable option lets users disable the LIFO task.
/// Now that the LIFO slot is stealable, we may remove this option in a
/// future version.
/// Eventually, the LIFO slot **will** become stealable, however as a
/// stop-gap, this unstable option lets users disable the LIFO task.
pub(crate) disable_lifo_slot: bool,

@@ -46,0 +44,0 @@

@@ -370,4 +370,4 @@ //! The Tokio runtime.

//! disabled using the [`disable_lifo_slot`] setting. The lifo slot is separate
//! from the local queue, and is stolen from by other worker threads only when
//! a worker's local queue has been drained.
//! from the local queue, so other worker threads cannot steal the task in the
//! lifo slot.
//!

@@ -374,0 +374,0 @@ //! When a task is woken from a thread that is not a worker thread, then the

@@ -55,9 +55,2 @@ //! Run-queue structures to support a work-stealing scheduler

/// When a task is scheduled from a worker, it is stored in this slot. The
/// worker will check this slot for a task **before** checking the run
/// queue. This effectively results in the **last** scheduled task to be run
/// next (LIFO). This is an optimization for improving locality which
/// benefits message passing patterns and helps to reduce latency.
lifo: task::AtomicNotified<T>,
/// Elements

@@ -103,3 +96,2 @@ buffer: Box<[UnsafeCell<MaybeUninit<task::Notified<T>>>; LOCAL_QUEUE_CAPACITY]>,

tail: AtomicUnsignedShort::new(0),
lifo: task::AtomicNotified::empty(),
buffer: make_fixed_size(buffer.into_boxed_slice()),

@@ -121,6 +113,5 @@ });

let (_, head) = unpack(self.inner.head.load(Acquire));
let lifo = self.inner.lifo.is_some() as usize;
// safety: this is the **only** thread that updates this cell.
let tail = unsafe { self.inner.tail.unsync_load() };
len(head, tail) + lifo
len(head, tail)
}

@@ -416,15 +407,2 @@

}
/// Pushes a task to the LIFO slot, returning the task previously in the
/// LIFO slot (if there was one).
pub(crate) fn push_lifo(&self, task: task::Notified<T>) -> Option<task::Notified<T>> {
self.inner.lifo.swap(Some(task))
}
/// Pops the task currently held in the LIFO slot, if there is one;
/// otherwise, returns `None`.
pub(crate) fn pop_lifo(&self) -> Option<task::Notified<T>> {
// LIFO-suction!
self.inner.lifo.take()
}
}

@@ -437,4 +415,3 @@

let tail = self.0.tail.load(Acquire);
let lifo = self.0.lifo.is_some() as usize;
len(head, tail) + lifo
len(head, tail)
}

@@ -474,10 +451,4 @@

if n == 0 {
// If no tasks were stolen, let's see if there's one in the LIFO
// slot.
let lifo = self.0.lifo.take();
if lifo.is_some() {
dst_stats.incr_steal_count(1);
dst_stats.incr_steal_operations();
}
return lifo;
// No tasks were stolen
return None;
}

@@ -614,3 +585,2 @@

assert!(self.pop().is_none(), "queue not empty");
assert!(self.pop_lifo().is_none(), "LIFO slot not empty");
}

@@ -617,0 +587,0 @@ }

@@ -115,2 +115,9 @@ //! A scheduler is initialized with a fixed number of workers. Each worker is

/// When a task is scheduled from a worker, it is stored in this slot. The
/// worker will check this slot for a task **before** checking the run
/// queue. This effectively results in the **last** scheduled task to be run
/// next (LIFO). This is an optimization for improving locality which
/// benefits message passing patterns and helps to reduce latency.
lifo_slot: Option<Notified>,
/// When `true`, locally scheduled tasks go to the LIFO slot. When `false`,

@@ -286,2 +293,3 @@ /// they go to the back of the `run_queue`.

tick: 0,
lifo_slot: None,
lifo_enabled: !config.disable_lifo_slot,

@@ -448,3 +456,3 @@ run_queue,

// stolen, so we move the task out of the lifo_slot to the run_queue.
if let Some(task) = core.run_queue.pop_lifo() {
if let Some(task) = core.lifo_slot.take() {
core.run_queue

@@ -702,3 +710,3 @@ .push_back_or_overflow(task, &*cx.worker.handle, &mut core.stats);

// Check for a task in the LIFO slot
let task = match core.run_queue.pop_lifo() {
let task = match core.lifo_slot.take() {
Some(task) => task,

@@ -1129,3 +1137,3 @@ None => {

fn next_local_task(&mut self) -> Option<Notified> {
self.run_queue.pop_lifo().or_else(|| self.run_queue.pop())
self.lifo_slot.take().or_else(|| self.run_queue.pop())
}

@@ -1186,3 +1194,3 @@

fn has_tasks(&self) -> bool {
self.run_queue.has_tasks()
self.lifo_slot.is_some() || self.run_queue.has_tasks()
}

@@ -1196,3 +1204,3 @@

}
self.run_queue.len() > 1
self.lifo_slot.is_some() as usize + self.run_queue.len() > 1
}

@@ -1359,13 +1367,19 @@

// flexibility and the task may go to the front of the queue.
if is_yield || !core.lifo_enabled {
let should_notify = if is_yield || !core.lifo_enabled {
core.run_queue
.push_back_or_overflow(task, self, &mut core.stats);
true
} else {
// Push to the LIFO slot
if let Some(prev) = core.run_queue.push_lifo(task) {
// There was a previous task in the LIFO slot which needs
// to be pushed to the back of the run queue.
let prev = core.lifo_slot.take();
let ret = prev.is_some();
if let Some(prev) = prev {
core.run_queue
.push_back_or_overflow(prev, self, &mut core.stats);
}
core.lifo_slot = Some(task);
ret
};

@@ -1376,3 +1390,3 @@

// batches, the notification is delayed until the park is complete.
if core.park.is_some() {
if should_notify && core.park.is_some() {
self.notify_parked_local();

@@ -1379,0 +1393,0 @@ }

@@ -212,7 +212,2 @@ //! The task module.

#[cfg(feature = "rt-multi-thread")]
mod atomic_notified;
#[cfg(feature = "rt-multi-thread")]
pub(crate) use self::atomic_notified::AtomicNotified;
mod waker;

@@ -219,0 +214,0 @@

@@ -65,62 +65,3 @@ use crate::runtime::scheduler::multi_thread::{queue, Stats};

// Like `basic`, but with tasks in the LIFO slot.
#[test]
fn basic_lifo() {
loom::model(|| {
let (steal, mut local) = queue::local();
let inject = RefCell::new(vec![]);
let mut stats = new_stats();
let th = thread::spawn(move || {
let mut stats = new_stats();
let (_, mut local) = queue::local();
let mut n = 0;
for _ in 0..3 {
if steal.steal_into(&mut local, &mut stats).is_some() {
n += 1;
}
while local.pop().is_some() {
n += 1;
}
}
n
});
let mut n = 0;
for _ in 0..2 {
for _ in 0..2 {
let (task, _) = unowned(async {});
if let Some(prev) = local.push_lifo(task) {
local.push_back_or_overflow(prev, &inject, &mut stats);
}
}
if local.pop_lifo().or_else(|| local.pop()).is_some() {
n += 1;
}
// Push another task
let (task, _) = unowned(async {});
if let Some(prev) = local.push_lifo(task) {
local.push_back_or_overflow(prev, &inject, &mut stats);
}
while local.pop_lifo().or_else(|| local.pop()).is_some() {
n += 1;
}
}
n += inject.borrow_mut().drain(..).count();
n += th.join().unwrap();
assert_eq!(6, n);
});
}
#[test]
fn steal_overflow() {

@@ -179,22 +120,12 @@ loom::model(|| {

loom::model(|| {
let (steal, mut local) = queue::local();
let inject = RefCell::new(vec![]);
fn steal_tasks(steal: queue::Steal<NoopSchedule>) -> usize {
let mut stats = new_stats();
let (_, mut local) = queue::local();
// Push work
for _ in 0..NUM_TASKS {
let (task, _) = unowned(async {});
local.push_back_or_overflow(task, &inject, &mut stats);
if steal.steal_into(&mut local, &mut stats).is_none() {
return 0;
}
let th1 = {
let steal = steal.clone();
thread::spawn(move || steal_tasks(steal))
};
let mut n = 1;
let th2 = thread::spawn(move || steal_tasks(steal));
let mut n = 0;
while local.pop().is_some() {

@@ -204,16 +135,5 @@ n += 1;

n += inject.borrow_mut().drain(..).count();
n
}
n += th1.join().unwrap();
n += th2.join().unwrap();
assert_eq!(n, NUM_TASKS);
});
}
// Like `multi_stealer`, but with tasks in the LIFO slot.
#[test]
fn multi_stealer_lifo() {
const NUM_TASKS: usize = 5;
loom::model(|| {

@@ -224,12 +144,6 @@ let (steal, mut local) = queue::local();

// Push work into the LIFO slot.
// Push work
for _ in 0..NUM_TASKS {
let (task, _) = unowned(async {});
// Push the new task into the LIFO slot, as though it's being
// notified locally.
if let Some(prev) = local.push_lifo(task) {
// If a task was already in the LIFO slot, stick the previous
// LIFO task into the queue.
local.push_back_or_overflow(prev, &inject, &mut stats);
}
local.push_back_or_overflow(task, &inject, &mut stats);
}

@@ -246,3 +160,3 @@

while local.pop_lifo().or_else(|| local.pop()).is_some() {
while local.pop().is_some() {
n += 1;

@@ -260,19 +174,2 @@ }

fn steal_tasks(steal: queue::Steal<NoopSchedule>) -> usize {
let mut stats = new_stats();
let (_, mut local) = queue::local();
if steal.steal_into(&mut local, &mut stats).is_none() {
return 0;
}
let mut n = 1;
while local.pop().is_some() {
n += 1;
}
n
}
#[test]

@@ -279,0 +176,0 @@ fn chained_steal() {

@@ -8,4 +8,2 @@ mod level;

use std::array;
/// Hashed timing wheel implementation.

@@ -45,5 +43,9 @@ ///

pub(crate) fn new() -> Wheel {
let mut levels = Vec::with_capacity(NUM_LEVELS);
for i in 0..NUM_LEVELS {
levels.push(Level::new(i));
}
Wheel {
elapsed: 0,
levels: Box::new(array::from_fn(Level::new)),
levels: levels.into_boxed_slice().try_into().unwrap(),
}

@@ -50,0 +52,0 @@ }

@@ -8,3 +8,3 @@ use crate::runtime::time::{TimerHandle, TimerShared};

use std::{array, ptr::NonNull};
use std::ptr::NonNull;

@@ -54,5 +54,9 @@ use super::entry::STATE_DEREGISTERED;

pub(crate) fn new() -> Wheel {
let mut levels = Vec::with_capacity(NUM_LEVELS);
for i in 0..NUM_LEVELS {
levels.push(Level::new(i));
}
Wheel {
elapsed: 0,
levels: Box::new(array::from_fn(Level::new)),
levels: levels.into_boxed_slice().try_into().unwrap(),
pending: EntryList::new(),

@@ -59,0 +63,0 @@ }

@@ -145,2 +145,21 @@ //! Allows a future to execute for a maximum amount of time.

/// ```
///
/// # Panics
///
/// This function panics if there is no current timer set.
///
/// It can be triggered when [`Builder::enable_time`] or
/// [`Builder::enable_all`] are not included in the builder.
///
/// It can also panic whenever a timer is created outside of a
/// Tokio runtime. That is why `rt.block_on(sleep(...))` will panic,
/// since the function is executed outside of the runtime.
/// Whereas `rt.block_on(async {sleep(...).await})` doesn't panic.
/// And this is because wrapping the function on an async makes it lazy,
/// and so gets executed inside the runtime successfully without
/// panicking.
///
/// [`Builder::enable_time`]: crate::runtime::Builder::enable_time
/// [`Builder::enable_all`]: crate::runtime::Builder::enable_all
#[track_caller]
pub fn timeout_at<F>(deadline: Instant, future: F) -> Timeout<F::IntoFuture>

@@ -151,7 +170,3 @@ where

let delay = sleep_until(deadline);
Timeout {
value: future.into_future(),
delay,
}
Timeout::new_with_delay(future.into_future(), delay)
}

@@ -158,0 +173,0 @@

@@ -9,3 +9,3 @@ #![warn(rust_2018_idioms)]

#[tokio::test]
async fn symlink_file_windows() {
async fn symlink_dir_windows() {
const FILE_NAME: &str = "abc.txt";

@@ -12,0 +12,0 @@

@@ -229,3 +229,2 @@ #![cfg(feature = "full")]

#[tokio::test]
#[cfg_attr(miri, ignore)] // No `fstat` in miri.
async fn from_file_detects_not_a_fifo() -> io::Result<()> {

@@ -504,3 +503,2 @@ let dir = tempfile::Builder::new()

#[cfg(target_os = "linux")]
#[cfg_attr(miri, ignore)] // No `fstat` in miri.
async fn anon_pipe_from_owned_fd() -> std::io::Result<()> {

@@ -507,0 +505,0 @@ use nix::fcntl::OFlag;

@@ -695,109 +695,3 @@ #![warn(rust_2018_idioms)]

// Tests that when a task is notified by another task and is placed in the LIFO
// slot, and then the notifying task blocks the runtime, the notified task will
// be stolen by another worker thread.
//
// Integration test for: https://github.com/tokio-rs/tokio/issues/4941
#[test]
fn lifo_stealable() {
use std::time::Duration;
// This test constructs a scenario where a task (the "blocker task")
// notifies another task (the "victim task") and then blocks that worker
// thread indefinitely. The victim task is placed in the worker's LIFO
// slot, and will only run to completion if another worker steals it from
// the LIFO slot, as the current worker remains blocked running the blocker
// task.
//
// To make the blocker task block its worker thread without yielding, we use
// a `std::sync` blocking channel, so that we can eventually unblock it when
// the test completes.
let (block_thread_tx, block_thread_rx) = mpsc::channel::<()>();
// We use this channel to wait until the victim task has started running. If
// we just spawned the victim task and then immediately blocked the worker
// thread, it would be in the global inject queue, rather than in the
// worker's LIFO slot.
let (task_started_tx, task_started_rx) = tokio::sync::oneshot::channel();
// Finally, this channel is used by the blocker task to wake up the victim
// task, so that it is placed in the worker's LIFO slot.
let (notify_tx, notify_rx) = tokio::sync::oneshot::channel();
let rt = runtime::Builder::new_multi_thread()
// Make sure there are enough workers that one can be parked running the
// I/O driver and another can be parked running the timer wheel and
// there's still at least one worker free to steal the blocked task.
.worker_threads(4)
.enable_time()
.build()
.unwrap();
rt.block_on(async {
// Keep the runtime busy so that the workers that might steal the
// blocked task don't all park themselves forever.
//
// Since this task will always be woken by whichever worker is holding
// the time driver, rather than a worker that's executing tasks, it
// shouldn't ever kick the victim task out of its worker's LIFO slot.
let churn = tokio::spawn(async move {
loop {
tokio::time::sleep(Duration::from_millis(4)).await;
}
});
let victim_task_joined = tokio::spawn(async move {
println!("[victim] task started");
task_started_tx.send(()).unwrap();
println!("[victim] task waiting for wakeup...");
notify_rx.await.unwrap();
println!("[victim] task running after wakeup");
});
// Wait for the victim task to have been polled once and have yielded
// before we spawn the task that will notify it. This ensures that it
// will be placed in the LIFO slot of the same worker thread as the
// blocker task, rather than on the global injector queue.
task_started_rx.await.unwrap();
println!("[main] victim slot task start acked!");
// Now, spawn a task that will notify the victim task before going
// blocking forever.
tokio::spawn(async move {
println!("[blocker] sending wakeup");
notify_tx.send(()).unwrap();
println!("[blocker] blocking the worker thread...");
// Block the worker thread indefinitely by waiting for a message on
// a blocking channel. Since we just notified the victim task, it
// went into the current worker thread's LIFO slot, and will only
// be able to complete if another worker thread successfully steals
// it from the LIFO slot.
//
// Using a channel rather than e.g. `loop {}` allows us to terminate
// the task cleanly when the test finishes.
let _ = block_thread_rx.recv();
println!("[blocker] done");
});
println!("[main] blocker task spawned");
// Wait for the victim task to join. If it does, then it has been stolen
// by another worker thread successfully.
//
// The 30-second timeout is chosen arbitrarily: its purpose is to ensure
// that the failure mode for this test is a panic, rather than hanging
// indefinitely. 30 seconds should be plenty of time for the task to be
// stolen, if it's going to work.
let result = tokio::time::timeout(Duration::from_secs(30), victim_task_joined).await;
println!("[main] result: {result:?}");
// Before possibly panicking, make sure that we wake up the blocker task
// so that it doesn't stop the runtime from shutting down.
block_thread_tx.send(()).unwrap();
churn.abort();
result
.expect("task in LIFO slot should complete within 30 seconds")
.expect("task in LIFO slot should not panic");
})
}
#[test]
/// Deferred tasks should be woken before starting the [`tokio::task::block_in_place`]

@@ -804,0 +698,0 @@ // https://github.com/tokio-rs/tokio/issues/7877

@@ -677,9 +677,5 @@ #![warn(rust_2018_idioms)]

// Bump the next-run spawn
let nop = tokio::spawn(async {});
tokio::spawn(async {});
// Wait until we're sure the other worker is blocked.
rx1.recv().unwrap();
// Make sure the no-op task has terminated so that it doesn't end up
// in the LIFO slot and throw off our counts.
let _ = nop.await;

@@ -686,0 +682,0 @@ // Spawn some tasks

@@ -9,3 +9,3 @@ #![warn(rust_2018_idioms)]

use tokio::runtime::{Builder, Runtime};
use tokio::time::{self, interval, interval_at, timeout, Instant};
use tokio::time::{self, interval, interval_at, timeout, timeout_at, Instant};

@@ -135,2 +135,18 @@ mod support {

#[test]
fn timeout_at_panic_caller() -> Result<(), Box<dyn Error>> {
let panic_location_file = test_panic(|| {
// Runtime without `enable_time` so it has no current timer set.
let rt = Builder::new_current_thread().build().unwrap();
rt.block_on(async {
let _timeout = timeout_at(Instant::now(), future::pending::<()>());
});
});
// The panic location should be in this file
assert_eq!(&panic_location_file.unwrap(), file!());
Ok(())
}
fn current_thread() -> Runtime {

@@ -137,0 +153,0 @@ tokio::runtime::Builder::new_current_thread()

use crate::loom::sync::atomic::AtomicPtr;
use crate::runtime::task::{Header, Notified, RawTask};
use std::marker::PhantomData;
use std::ptr;
use std::ptr::NonNull;
use std::sync::atomic::Ordering::SeqCst;
/// An atomic cell which can contain a pointer to a [`Notified`] task.
///
/// This is similar to the `crate::util::AtomicCell` type, but specialized to
/// hold a task pointer --- this type "remembers" the task's scheduler generic
/// when a task is stored in the cell, so that the pointer can be turned back
/// into a [`Notified`] task with the correct generic type when it is retrieved.
pub(crate) struct AtomicNotified<S: 'static> {
task: AtomicPtr<Header>,
_scheduler: PhantomData<S>,
}
impl<S: 'static> AtomicNotified<S> {
pub(crate) fn empty() -> Self {
Self {
task: AtomicPtr::new(ptr::null_mut()),
_scheduler: PhantomData,
}
}
pub(crate) fn swap(&self, task: Option<Notified<S>>) -> Option<Notified<S>> {
let new = task
.map(|t| t.into_raw().header_ptr().as_ptr())
.unwrap_or_else(ptr::null_mut);
let old = self.task.swap(new, SeqCst);
NonNull::new(old).map(|ptr| unsafe {
// Safety: since we only allow tasks with the same scheduler type to
// be placed in this cell, we know that the pointed task's scheduler
// type matches the type parameter S.
Notified::from_raw(RawTask::from_raw(ptr))
})
}
pub(crate) fn take(&self) -> Option<Notified<S>> {
self.swap(None)
}
pub(crate) fn is_some(&self) -> bool {
!self.task.load(SeqCst).is_null()
}
}
unsafe impl<S: Send> Send for AtomicNotified<S> {}
unsafe impl<S: Send> Sync for AtomicNotified<S> {}
impl<S> Drop for AtomicNotified<S> {
fn drop(&mut self) {
// Ensure the task reference is dropped if this cell is dropped.
let _ = self.take();
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display