Skip to content

Commit

Permalink
upgrade to futures 0.3.25
Browse files Browse the repository at this point in the history
  • Loading branch information
jswrenn committed Oct 20, 2022
1 parent 94b96c7 commit 5611fae
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion backtrace/Cargo.toml
Expand Up @@ -18,7 +18,7 @@ static_assertions = "1.1.0"
[dev-dependencies]
core_affinity = "0.5.10"
criterion = { version = "0.3.4", features = ["html_reports"] }
futures = "0.3.21"
futures = "0.3.25"
pretty_assertions = "1.3.0"
regex = "1.6.0"
smol = "1.2.5"
Expand Down
2 changes: 1 addition & 1 deletion backtrace/examples/taskdump.rs
Expand Up @@ -26,7 +26,7 @@ async fn foo() {

#[async_backtrace::framed]
async fn bar() {
tokio::join!(Box::pin(fiz()), Box::pin(buz()));
futures::join!(fiz(), buz());
}

#[async_backtrace::framed]
Expand Down
24 changes: 17 additions & 7 deletions backtrace/src/lib.rs
Expand Up @@ -6,7 +6,15 @@
//! ```rust
//! #[tokio::main]
//! async fn main() {
//! foo().await;
//! tokio::select! {
//! _ = tokio::spawn(pending()) => {}
//! _ = foo() => {}
//! };
//! }
//!
//! #[async_backtrace::framed]
//! async fn pending() {
//! std::future::pending::<()>().await
//! }
//!
//! #[async_backtrace::framed]
Expand All @@ -16,7 +24,7 @@
//!
//! #[async_backtrace::framed]
//! async fn bar() {
//! tokio::join!(Box::pin(fiz()), Box::pin(buz()));
//! futures::join!(fiz(), buz());
//! }
//!
//! #[async_backtrace::framed]
Expand All @@ -26,7 +34,7 @@
//!
//! #[async_backtrace::framed]
//! async fn buz() {
//! println!("{}", tokio::spawn(baz()).await.unwrap());
//! println!("{}", baz().await);
//! }
//!
//! #[async_backtrace::framed]
Expand All @@ -36,10 +44,12 @@
//! ```
//! The above program, when run, prints something like:
//! ```text
//! ╼ taskdump::foo::{{closure}} at backtrace/examples/taskdump.rs:6:1
//! └╼ taskdump::bar::{{closure}} at backtrace/examples/taskdump.rs:11:1
//! └╼ taskdump::buz::{{closure}} at backtrace/examples/taskdump.rs:21:1
//! ╼ taskdump::baz::{{closure}} at backtrace/examples/taskdump.rs:26:1
//! ╼ taskdump::foo::{{closure}} at backtrace/examples/taskdump.rs:14:1
//! └╼ taskdump::bar::{{closure}} at backtrace/examples/taskdump.rs:19:1
//! ├╼ taskdump::buz::{{closure}} at backtrace/examples/taskdump.rs:29:1
//! │ └╼ taskdump::baz::{{closure}} at backtrace/examples/taskdump.rs:34:1
//! └╼ taskdump::fiz::{{closure}} at backtrace/examples/taskdump.rs:24:1
//! ╼ taskdump::pending::{{closure}} at backtrace/examples/taskdump.rs:9:1
//! ```

pub(crate) mod frame;
Expand Down

0 comments on commit 5611fae

Please sign in to comment.