diff --git a/Cargo.toml b/Cargo.toml index 6eff27e..f096c6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ name = "stackfuture" description = "StackFuture is a wrapper around futures that stores the wrapped future in space provided by the caller." version = "0.3.0" -edition = "2021" +edition = "2024" license = "MIT" authors = ["Microsoft"] repository = "https://github.com/microsoft/stackfuture" diff --git a/rustfmt.toml b/rustfmt.toml index a15352f..c7ef391 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,2 +1,2 @@ -edition = "2021" +edition = "2024" reorder_imports = true diff --git a/src/lib.rs b/src/lib.rs index 12d8173..dd54a1c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -378,19 +378,22 @@ impl IntoStackFutureError { impl Display for IntoStackFutureError { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match (self.alignment_too_small(), self.insufficient_space()) { - (true, true) => write!(f, + (true, true) => write!( + f, "cannot create StackFuture, required size is {}, available space is {}; required alignment is {} but maximum alignment is {}", self.required_space(), self.available_space(), self.required_alignment(), self.available_alignment() ), - (true, false) => write!(f, + (true, false) => write!( + f, "cannot create StackFuture, required alignment is {} but maximum alignment is {}", self.required_alignment(), self.available_alignment() ), - (false, true) => write!(f, + (false, true) => write!( + f, "cannot create StackFuture, required size is {}, available space is {}", self.required_space(), self.available_space() diff --git a/src/tests.rs b/src/tests.rs index 56b01e2..87288f4 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -1,12 +1,12 @@ use crate::StackFuture; use core::task::Poll; -use futures::channel::mpsc; -use futures::executor::block_on; -use futures::pin_mut; use futures::Future; use futures::SinkExt; use futures::Stream; use futures::StreamExt; +use futures::channel::mpsc; +use futures::executor::block_on; +use futures::pin_mut; use std::sync::Arc; use std::task::Context; use std::task::Wake; @@ -103,6 +103,7 @@ fn test_alignment() { // A test to make sure we store the wrapped future with the correct alignment #[repr(align(8))] + #[allow(dead_code)] struct BigAlignment(u32); impl Future for BigAlignment { @@ -121,6 +122,7 @@ fn test_alignment_failure() { // A test to make sure we store the wrapped future with the correct alignment #[repr(align(256))] + #[allow(dead_code)] struct BigAlignment(u32); impl Future for BigAlignment { @@ -142,6 +144,7 @@ fn test_boxed_alignment() { // A test to make sure we store the wrapped future with the correct alignment #[repr(align(256))] + #[allow(dead_code)] struct BigAlignment(u32); impl Future for BigAlignment {