diff --git a/Cargo.lock b/Cargo.lock index 9b25b574a46..5d45d51ac4b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2924,7 +2924,7 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.45.1" +version = "0.45.2" dependencies = [ "async-io 2.3.3", "async-std", diff --git a/Cargo.toml b/Cargo.toml index 76bb4f18b3d..ab660cc90e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -86,7 +86,7 @@ libp2p-gossipsub = { version = "0.46.2", path = "protocols/gossipsub" } libp2p-identify = { version = "0.45.0", path = "protocols/identify" } libp2p-identity = { version = "0.2.9" } libp2p-kad = { version = "0.46.0", path = "protocols/kad" } -libp2p-mdns = { version = "0.45.1", path = "protocols/mdns" } +libp2p-mdns = { version = "0.45.2", path = "protocols/mdns" } libp2p-memory-connection-limits = { version = "0.2.0", path = "misc/memory-connection-limits" } libp2p-metrics = { version = "0.14.2", path = "misc/metrics" } libp2p-mplex = { version = "0.41.0", path = "muxers/mplex" } diff --git a/protocols/mdns/CHANGELOG.md b/protocols/mdns/CHANGELOG.md index cfd02232b07..18fe0e76e6f 100644 --- a/protocols/mdns/CHANGELOG.md +++ b/protocols/mdns/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.45.2 + +- Add `#[track_caller]` on all `spawn` wrappers. + See [PR 5465](https://github.com/libp2p/rust-libp2p/pull/5465). + ## 0.45.1 - Ensure `Multiaddr` handled and returned by `Behaviour` are `/p2p` terminated. diff --git a/protocols/mdns/Cargo.toml b/protocols/mdns/Cargo.toml index 56741463d6b..724c8818621 100644 --- a/protocols/mdns/Cargo.toml +++ b/protocols/mdns/Cargo.toml @@ -2,7 +2,7 @@ name = "libp2p-mdns" edition = "2021" rust-version = { workspace = true } -version = "0.45.1" +version = "0.45.2" description = "Implementation of the libp2p mDNS discovery method" authors = ["Parity Technologies "] license = "MIT" diff --git a/protocols/mdns/src/behaviour.rs b/protocols/mdns/src/behaviour.rs index 4e3533f26ab..d4a0a707a01 100644 --- a/protocols/mdns/src/behaviour.rs +++ b/protocols/mdns/src/behaviour.rs @@ -55,6 +55,7 @@ pub trait Provider: 'static { /// Create a new instance of the `IfWatcher` type. fn new_watcher() -> Result; + #[track_caller] fn spawn(task: impl Future + Send + 'static) -> Self::TaskHandle; } diff --git a/swarm/CHANGELOG.md b/swarm/CHANGELOG.md index 1b53ee9b937..1139c40021f 100644 --- a/swarm/CHANGELOG.md +++ b/swarm/CHANGELOG.md @@ -5,6 +5,8 @@ - Use `web-time` instead of `instant`. See [PR 5347](https://github.com/libp2p/rust-libp2p/pull/5347). +- Add `#[track_caller]` on all `spawn` wrappers. + See [PR 5465](https://github.com/libp2p/rust-libp2p/pull/5465). ## 0.44.2 diff --git a/swarm/src/connection/pool.rs b/swarm/src/connection/pool.rs index 236f76e2fcc..48ba92f1020 100644 --- a/swarm/src/connection/pool.rs +++ b/swarm/src/connection/pool.rs @@ -70,6 +70,7 @@ impl ExecSwitch { } } + #[track_caller] fn spawn(&mut self, task: impl Future + Send + 'static) { let task = task.boxed(); diff --git a/swarm/src/executor.rs b/swarm/src/executor.rs index e949bf3cbde..a2abbbde6ef 100644 --- a/swarm/src/executor.rs +++ b/swarm/src/executor.rs @@ -11,6 +11,7 @@ use std::{future::Future, pin::Pin}; /// > about running `Future`s on a separate task. pub trait Executor { /// Run the given future in the background until it ends. + #[track_caller] fn exec(&self, future: Pin + Send>>); }