diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 5f50f4b..e8fa0fd 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -17,11 +17,12 @@ rustdoc-args = ["--document-private-items"] default = [] # Disables any tests that are not compatible or not intended to run under Miri miri = [] -__tokio = ["tokio"] +std = [] +__tokio = ["tokio", "std"] [dependencies] ouroboros = { version = "0.15.7", path = "../ouroboros" } -tokio = { version = "1.25.0", features = [ "macros", "rt" ], optional = true } +tokio = { version = "1.27.0", features = [ "macros", "rt" ], optional = true } [dev-dependencies] rustversion = "1.0.11" diff --git a/examples/src/lib.rs b/examples/src/lib.rs index 2ed201e..3198651 100644 --- a/examples/src/lib.rs +++ b/examples/src/lib.rs @@ -1,4 +1,5 @@ -#![no_std] +#![cfg_attr(not(feature = "std"), no_std)] + extern crate alloc; use alloc::boxed::Box; diff --git a/examples/src/ok_tests.rs b/examples/src/ok_tests.rs index 2a4affd..61ae346 100644 --- a/examples/src/ok_tests.rs +++ b/examples/src/ok_tests.rs @@ -94,6 +94,7 @@ fn box_and_ref() { #[cfg(all(not(feature = "miri"), feature = "tokio"))] #[tokio::test] async fn async_new() { + use std::future::Future; let bar = BoxAndRefAsyncBuilder { data: 12, dref_builder: |data| Box::pin(async move { data }),