diff --git a/Cargo.toml b/Cargo.toml index b21416c20c..669aa8c154 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,7 @@ exclude = [ [workspace.package] rust-version = "1.85" -edition = "2021" +edition = "2024" [workspace.dependencies] xtask_fuzz = { path = "xtask/xtask_fuzz" } diff --git a/Guide/mdbook-openvmm-shim/Cargo.toml b/Guide/mdbook-openvmm-shim/Cargo.toml index 2c4c88b195..2d647e8612 100644 --- a/Guide/mdbook-openvmm-shim/Cargo.toml +++ b/Guide/mdbook-openvmm-shim/Cargo.toml @@ -3,7 +3,7 @@ [package] name = "mdbook-openvmm-shim" -edition = "2021" +edition = "2024" [package.metadata.xtask.house-rules] # emits a binary, where kebab-case is more natural diff --git a/flowey/flowey_cli/src/pipeline_resolver/ado_yaml.rs b/flowey/flowey_cli/src/pipeline_resolver/ado_yaml.rs index 67260dcc64..31b5e116be 100644 --- a/flowey/flowey_cli/src/pipeline_resolver/ado_yaml.rs +++ b/flowey/flowey_cli/src/pipeline_resolver/ado_yaml.rs @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. +use super::common_yaml::FloweySource; use super::common_yaml::check_generated_yaml_and_json; use super::common_yaml::job_flowey_bootstrap_source; use super::common_yaml::write_generated_yaml_and_json; -use super::common_yaml::FloweySource; use super::generic::ResolvedJobArtifact; use super::generic::ResolvedJobUseParameter; use crate::cli::exec_snippet::FloweyPipelineStaticDb; @@ -127,7 +127,9 @@ pub fn ado_yaml( let _ = (artifact, publish); if ado_bootstrap_template.is_empty() { - anyhow::bail!("Did not specify flowey bootstrap template. Please provide one using `Pipeline::ado_set_flowey_bootstrap_template`") + anyhow::bail!( + "Did not specify flowey bootstrap template. Please provide one using `Pipeline::ado_set_flowey_bootstrap_template`" + ) } let ado_bootstrap_template = ado_bootstrap_template @@ -267,6 +269,7 @@ echo "$(FLOWEY_TEMP_DIR)/work" | {var_db_insert_working_dir} "### ) .trim_start() + .to_owned() })?; // import pipeline vars being used by the job into flowey diff --git a/flowey/flowey_cli/src/pipeline_resolver/github_yaml/mod.rs b/flowey/flowey_cli/src/pipeline_resolver/github_yaml/mod.rs index 8d47c79421..b4c5b67c99 100644 --- a/flowey/flowey_cli/src/pipeline_resolver/github_yaml/mod.rs +++ b/flowey/flowey_cli/src/pipeline_resolver/github_yaml/mod.rs @@ -12,18 +12,18 @@ use crate::cli::exec_snippet::VAR_DB_SEEDVAR_FLOWEY_WORKING_DIR; use crate::cli::pipeline::CheckMode; use crate::flow_resolver::stage1_dag::OutputGraphEntry; use crate::flow_resolver::stage1_dag::Step; -use crate::pipeline_resolver::common_yaml::job_flowey_bootstrap_source; use crate::pipeline_resolver::common_yaml::FloweySource; +use crate::pipeline_resolver::common_yaml::job_flowey_bootstrap_source; use crate::pipeline_resolver::generic::ResolvedPipeline; use crate::pipeline_resolver::generic::ResolvedPipelineJob; use anyhow::Context; -use flowey_core::node::user_facing::GhPermission; -use flowey_core::node::user_facing::GhPermissionValue; use flowey_core::node::FlowArch; use flowey_core::node::FlowBackend; use flowey_core::node::FlowPlatform; use flowey_core::node::FlowPlatformKind; use flowey_core::node::NodeHandle; +use flowey_core::node::user_facing::GhPermission; +use flowey_core::node::user_facing::GhPermissionValue; use flowey_core::pipeline::GhRunner; use flowey_core::pipeline::GhRunnerOsLabel; use std::collections::BTreeMap; @@ -127,7 +127,9 @@ pub fn github_yaml( // actual artifact publish happens at the end of the job if let FloweySource::Bootstrap(_artifact, _publish) = &flowey_source { if gh_bootstrap_template.is_empty() { - anyhow::bail!("Did not specify flowey bootstrap template. Please provide one using `Pipeline::gh_set_flowey_bootstrap_template`") + anyhow::bail!( + "Did not specify flowey bootstrap template. Please provide one using `Pipeline::gh_set_flowey_bootstrap_template`" + ) } let gh_bootstrap_template = gh_bootstrap_template @@ -336,7 +338,7 @@ echo '"{runtime_debug_level}"' | {var_db_insert_runtime_debug_level} echo "{RUNNER_TEMP}/work" | {var_db_insert_working_dir} "### ) - .trim_start() + .trim_start().to_owned() })?; // import pipeline vars being used by the job into flowey diff --git a/openhcl/ohcldiag-dev/src/main.rs b/openhcl/ohcldiag-dev/src/main.rs index 9094d27332..08976b3939 100644 --- a/openhcl/ohcldiag-dev/src/main.rs +++ b/openhcl/ohcldiag-dev/src/main.rs @@ -895,7 +895,7 @@ fn create_or_stderr(path: &Option) -> std::io::Result { async fn capture_packets( client: DiagClient, - streams: Vec>>, + streams: Vec>>, capture_duration: Duration, ) { let mut capture_streams = FuturesUnordered::from_iter(streams); diff --git a/openhcl/underhill_core/src/emuplat/netvsp.rs b/openhcl/underhill_core/src/emuplat/netvsp.rs index 905392c09d..28b325f9d9 100644 --- a/openhcl/underhill_core/src/emuplat/netvsp.rs +++ b/openhcl/underhill_core/src/emuplat/netvsp.rs @@ -986,7 +986,7 @@ impl HclNetworkVFManager { ) -> anyhow::Result> where F: Fn(bool) -> R + Sync + Send + 'static, - R: std::future::Future + Send, + R: Future + Send, { let (tx_update, rx_update) = mesh::channel(); let guest_state = self @@ -1095,7 +1095,7 @@ impl HclNetworkVFManagerInstance { impl netvsp::VirtualFunction for HclNetworkVFManagerInstance where F: Fn(bool) -> R + Sync + Send + 'static, - R: std::future::Future + Send, + R: Future + Send, { async fn id(&self) -> Option { self.guest_state.vtl0_vfid().await diff --git a/openhcl/underhill_core/src/loader/mod.rs b/openhcl/underhill_core/src/loader/mod.rs index 84e246c8c4..aa22c04d04 100644 --- a/openhcl/underhill_core/src/loader/mod.rs +++ b/openhcl/underhill_core/src/loader/mod.rs @@ -12,8 +12,8 @@ use guestmem::GuestMemory; use hvdef::HV_PAGE_SIZE; use igvm_defs::MemoryMapEntryType; use loader::importer::Register; -use loader::uefi::config; use loader::uefi::IMAGE_SIZE; +use loader::uefi::config; use loader_defs::paravisor::PageRegionDescriptor; use memory_range::MemoryRange; #[cfg(guest_arch = "x86_64")] @@ -541,11 +541,9 @@ pub fn write_uefi_config( &platform_config.smbios.chassis_asset_tag, ); - cfg.add({ - &config::NvdimmCount { - count: platform_config.general.nvdimm_count, - padding: [0; 3], - } + cfg.add(&config::NvdimmCount { + count: platform_config.general.nvdimm_count, + padding: [0; 3], }); if let Some(instance_guid) = platform_config.general.vpci_instance_filter { diff --git a/openhcl/virt_mshv_vtl/src/processor/mod.rs b/openhcl/virt_mshv_vtl/src/processor/mod.rs index ba89fd5622..7b9df6e4e8 100644 --- a/openhcl/virt_mshv_vtl/src/processor/mod.rs +++ b/openhcl/virt_mshv_vtl/src/processor/mod.rs @@ -182,8 +182,7 @@ mod private { use hv1_emulator::hv::ProcessorVtlHv; use hv1_emulator::synic::ProcessorSynic; use inspect::InspectMut; - use std::future::Future; - use virt::io::CpuIo; + use virt::io::CpuIo; use virt::vp::AccessVpState; use virt::StopVp; use virt::VpHaltReason; diff --git a/openvmm/membacking/src/mapping_manager/object_cache.rs b/openvmm/membacking/src/mapping_manager/object_cache.rs index 96ae99c8af..d146be280b 100644 --- a/openvmm/membacking/src/mapping_manager/object_cache.rs +++ b/openvmm/membacking/src/mapping_manager/object_cache.rs @@ -9,7 +9,6 @@ use mesh::MeshPayload; use parking_lot::Mutex; -use std::future::Future; use std::sync::Arc; use std::sync::Weak; diff --git a/openvmm/openvmm_entry/src/ttrpc/mod.rs b/openvmm/openvmm_entry/src/ttrpc/mod.rs index 04a979e305..ae0c254a97 100644 --- a/openvmm/openvmm_entry/src/ttrpc/mod.rs +++ b/openvmm/openvmm_entry/src/ttrpc/mod.rs @@ -49,7 +49,6 @@ use pal_async::DefaultPool; use parking_lot::Mutex; use scsidisk_resources::SimpleScsiDiskHandle; use std::fs::File; -use std::future::Future; use std::sync::Arc; use std::time::Duration; use storvsp_resources::ScsiControllerHandle; diff --git a/petri/src/vm/openvmm/runtime.rs b/petri/src/vm/openvmm/runtime.rs index b50b1c8773..6d964a4c41 100644 --- a/petri/src/vm/openvmm/runtime.rs +++ b/petri/src/vm/openvmm/runtime.rs @@ -28,7 +28,6 @@ use pal_async::DefaultDriver; use petri_artifacts_common::tags::GuestQuirks; use petri_artifacts_core::ResolvedArtifact; use pipette_client::PipetteClient; -use std::future::Future; use std::path::Path; use std::sync::Arc; use std::time::Duration; diff --git a/support/clap_dyn_complete/src/lib.rs b/support/clap_dyn_complete/src/lib.rs index 6f03c02d3f..fe10da229f 100644 --- a/support/clap_dyn_complete/src/lib.rs +++ b/support/clap_dyn_complete/src/lib.rs @@ -286,7 +286,7 @@ pub trait CustomCompleterFactory: Send + Sync { type CustomCompleter: CustomCompleter + 'static; /// Build a new [`CustomCompleter`]. - fn build(&self, ctx: &RootCtx<'_>) -> impl std::future::Future; + fn build(&self, ctx: &RootCtx<'_>) -> impl Future; } /// A custom completer for a particular argument. @@ -297,7 +297,7 @@ pub trait CustomCompleter: Send + Sync { ctx: &RootCtx<'_>, subcommand_path: &[&str], arg_id: &str, - ) -> impl Send + std::future::Future>; + ) -> impl Send + Future>; } #[async_trait::async_trait] diff --git a/support/fast_select/src/lib.rs b/support/fast_select/src/lib.rs index d0b904b55f..5cc1d90b4a 100644 --- a/support/fast_select/src/lib.rs +++ b/support/fast_select/src/lib.rs @@ -19,15 +19,14 @@ #![expect(unsafe_code)] use parking_lot::Mutex; -use std::future::Future; use std::marker::PhantomData; use std::mem::ManuallyDrop; use std::ops::Deref; -use std::pin::pin; use std::pin::Pin; +use std::pin::pin; +use std::sync::Arc; use std::sync::atomic::AtomicU32; use std::sync::atomic::Ordering; -use std::sync::Arc; use std::task::Context; use std::task::Poll; use std::task::RawWaker; @@ -366,9 +365,9 @@ impl Deref for WakerRef<'_> { #[cfg(test)] mod tests { use crate::FastSelect; + use pal_async::DefaultDriver; use pal_async::async_test; use pal_async::timer::PolledTimer; - use pal_async::DefaultDriver; use std::future::pending; use std::time::Duration; diff --git a/support/inspect/src/initiate.rs b/support/inspect/src/initiate.rs index 5c39f97ff7..dac1ee400a 100644 --- a/support/inspect/src/initiate.rs +++ b/support/inspect/src/initiate.rs @@ -22,7 +22,6 @@ use core::cmp::Ordering; use core::fmt; use core::fmt::Write; use core::future::poll_fn; -use core::future::Future; use core::pin::Pin; use core::task::Context; use core::task::Poll; diff --git a/support/mesh/mesh_channel/src/bidir.rs b/support/mesh/mesh_channel/src/bidir.rs index 5f9416a7c2..c28de9ea9e 100644 --- a/support/mesh/mesh_channel/src/bidir.rs +++ b/support/mesh/mesh_channel/src/bidir.rs @@ -3,15 +3,15 @@ //! A bidirectional channel implemented on top of [`Port`]. +use super::RecvError; +use super::TryRecvError; +use super::lazy::DeserializeFn; +use super::lazy::LazyMessage; +use super::lazy::SerializeFn; use super::lazy::deserializer; use super::lazy::ensure_serializable; use super::lazy::lazy_parse; use super::lazy::serializer; -use super::lazy::DeserializeFn; -use super::lazy::LazyMessage; -use super::lazy::SerializeFn; -use super::RecvError; -use super::TryRecvError; use mesh_node::local_node::HandleMessageError; use mesh_node::local_node::HandlePortEvent; use mesh_node::local_node::NodeError; @@ -28,7 +28,6 @@ use std::collections::VecDeque; use std::fmt; use std::fmt::Debug; use std::future::poll_fn; -use std::future::Future; use std::task::Context; use std::task::Poll; use std::task::Waker; diff --git a/support/mesh/mesh_channel/src/cancel.rs b/support/mesh/mesh_channel/src/cancel.rs index 5dff3d5c18..5e60d3110f 100644 --- a/support/mesh/mesh_channel/src/cancel.rs +++ b/support/mesh/mesh_channel/src/cancel.rs @@ -8,13 +8,12 @@ use super::deadline::DeadlineId; use super::deadline::DeadlineSet; use mesh_node::local_node::Port; use mesh_node::resource::Resource; -use mesh_protobuf::encoding::IgnoreField; use mesh_protobuf::EncodeAs; use mesh_protobuf::Protobuf; use mesh_protobuf::SerializedMessage; use mesh_protobuf::Timestamp; +use mesh_protobuf::encoding::IgnoreField; use parking_lot::Mutex; -use std::future::Future; use std::pin::Pin; use std::sync::Arc; use std::sync::Weak; diff --git a/support/mesh/mesh_channel/src/cell.rs b/support/mesh/mesh_channel/src/cell.rs index b4a388655e..8a1cc7afcc 100644 --- a/support/mesh/mesh_channel/src/cell.rs +++ b/support/mesh/mesh_channel/src/cell.rs @@ -19,7 +19,6 @@ use mesh_protobuf::EncodeAs; use mesh_protobuf::Protobuf; use mesh_protobuf::SerializedMessage; use std::future::poll_fn; -use std::future::Future; use std::task::Context; use std::task::Poll; use std::task::Waker; @@ -160,11 +159,7 @@ impl CellUpdater { } } } - if wait { - Poll::Pending - } else { - Poll::Ready(()) - } + if wait { Poll::Pending } else { Poll::Ready(()) } }) } } @@ -329,9 +324,9 @@ impl From> for Inne #[cfg(test)] mod tests { use super::CellUpdater; + use pal_async::DefaultDriver; use pal_async::async_test; use pal_async::task::Spawn; - use pal_async::DefaultDriver; use std::future::poll_fn; use std::task::Poll; diff --git a/support/mesh/mesh_channel/src/lib.rs b/support/mesh/mesh_channel/src/lib.rs index 8ec0bb178e..8fd86d5cd2 100644 --- a/support/mesh/mesh_channel/src/lib.rs +++ b/support/mesh/mesh_channel/src/lib.rs @@ -108,22 +108,21 @@ mod error_oldchan { #[cfg(feature = "newchan_spsc")] mod spsc_newchan { - pub use mesh_channel_core::channel; pub use mesh_channel_core::Receiver; pub use mesh_channel_core::Sender; + pub use mesh_channel_core::channel; } #[cfg(not(feature = "newchan_spsc"))] mod spsc { - use crate::bidir::Channel; use crate::RecvError; use crate::TryRecvError; + use crate::bidir::Channel; use mesh_node::local_node::Port; use mesh_node::local_node::PortField; use mesh_node::message::MeshField; use mesh_protobuf::DefaultEncoding; use std::fmt::Debug; - use std::future::Future; use std::pin::Pin; use std::task::Context; use std::task::Poll; @@ -336,14 +335,13 @@ mod spsc { #[cfg(not(feature = "newchan_oneshot"))] mod oneshot { - use crate::bidir::Channel; use crate::RecvError; + use crate::bidir::Channel; use mesh_node::local_node::Port; use mesh_node::local_node::PortField; use mesh_node::message::MeshField; use mesh_protobuf::DefaultEncoding; use std::fmt::Debug; - use std::future::Future; use std::pin::Pin; use std::task::Context; use std::task::Poll; @@ -450,26 +448,25 @@ mod oneshot { #[cfg(feature = "newchan_oneshot")] mod oneshot_newchan { - pub use mesh_channel_core::oneshot; pub use mesh_channel_core::OneshotReceiver; pub use mesh_channel_core::OneshotSender; + pub use mesh_channel_core::oneshot; } #[cfg(feature = "newchan_mpsc")] mod mpsc_newchan { - pub use mesh_channel_core::channel as mpsc_channel; pub use mesh_channel_core::Receiver as MpscReceiver; pub use mesh_channel_core::Sender as MpscSender; + pub use mesh_channel_core::channel as mpsc_channel; } #[cfg(not(feature = "newchan_mpsc"))] mod mpsc { - use crate::bidir::Channel; use crate::RecvError; + use crate::bidir::Channel; use mesh_node::message::MeshField; use mesh_protobuf::Protobuf; use std::fmt::Debug; - use std::future::Future; use std::pin::Pin; use std::sync::Arc; use std::task::Context; @@ -631,7 +628,7 @@ mod mpsc { impl Debug for MpscSender { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - Debug::fmt(&self.0 .0, f) + Debug::fmt(&self.0.0, f) } } diff --git a/support/mesh/mesh_channel/src/rpc.rs b/support/mesh/mesh_channel/src/rpc.rs index 1d8587fb7c..988ae494e8 100644 --- a/support/mesh/mesh_channel/src/rpc.rs +++ b/support/mesh/mesh_channel/src/rpc.rs @@ -4,19 +4,18 @@ //! Remote Procedure Call functionality. use super::error::RemoteResult; -use crate::error::RemoteError; -use crate::oneshot; use crate::OneshotReceiver; use crate::OneshotSender; use crate::RecvError; +use crate::error::RemoteError; +use crate::oneshot; use mesh_node::message::MeshField; use mesh_protobuf::Protobuf; use std::convert::Infallible; use std::fmt::Debug; -use std::future::Future; use std::pin::Pin; -use std::task::ready; use std::task::Poll; +use std::task::ready; use thiserror::Error; /// An RPC message for a request with input of type `I` and output of type `R`. diff --git a/support/mesh/mesh_channel_core/src/mpsc.rs b/support/mesh/mesh_channel_core/src/mpsc.rs index 9c6b61167d..1a8c34016f 100644 --- a/support/mesh/mesh_channel_core/src/mpsc.rs +++ b/support/mesh/mesh_channel_core/src/mpsc.rs @@ -29,7 +29,6 @@ use crate::error::RecvError; use crate::error::TryRecvError; use crate::sync_unsafe_cell::SyncUnsafeCell; use core::fmt::Debug; -use core::future::Future; use core::marker::PhantomData; use core::mem::ManuallyDrop; use core::mem::MaybeUninit; @@ -909,12 +908,12 @@ impl HandlePortEvent for RemotePortHandler { #[cfg(test)] mod tests { - use super::channel; use super::Receiver; use super::Sender; + use super::channel; use crate::RecvError; - use futures::executor::block_on; use futures::StreamExt; + use futures::executor::block_on; use futures_core::FusedStream; use mesh_node::local_node::Port; use mesh_protobuf::Protobuf; diff --git a/support/mesh/mesh_channel_core/src/oneshot.rs b/support/mesh/mesh_channel_core/src/oneshot.rs index 280a14ac86..2dd9bbe50e 100644 --- a/support/mesh/mesh_channel_core/src/oneshot.rs +++ b/support/mesh/mesh_channel_core/src/oneshot.rs @@ -17,9 +17,9 @@ // UNSAFETY: needed to avoid monomorphization. #![expect(unsafe_code)] -use crate::sync_unsafe_cell::SyncUnsafeCell; use crate::ChannelError; use crate::RecvError; +use crate::sync_unsafe_cell::SyncUnsafeCell; use mesh_node::local_node::HandleMessageError; use mesh_node::local_node::HandlePortEvent; use mesh_node::local_node::Port; @@ -31,15 +31,14 @@ use mesh_node::message::OwnedMessage; use mesh_protobuf::DefaultEncoding; use parking_lot::Mutex; use std::fmt::Debug; -use std::future::Future; use std::marker::PhantomData; use std::mem::ManuallyDrop; use std::ptr::NonNull; use std::sync::Arc; -use std::task::ready; use std::task::Context; use std::task::Poll; use std::task::Waker; +use std::task::ready; use thiserror::Error; /// Creates a unidirection channel for sending a single value of type `T`. @@ -624,9 +623,9 @@ mod tests { use crate::OneshotReceiver; use crate::OneshotSender; use crate::RecvError; + use futures::FutureExt; use futures::executor::block_on; use futures::task::SpawnExt; - use futures::FutureExt; use mesh_node::local_node::Port; use mesh_node::message::Message; use std::cell::Cell; @@ -697,9 +696,11 @@ mod tests { let (sender, mut receiver) = oneshot::(); let sender = OneshotSender::::from(Port::from(sender)); // Ensure the receiver has seen the sender's port before converting. - assert!(poll_fn(|cx| receiver.poll_recv(cx)) - .now_or_never() - .is_none()); + assert!( + poll_fn(|cx| receiver.poll_recv(cx)) + .now_or_never() + .is_none() + ); let receiver = OneshotReceiver::::from(Port::from(receiver)); sender.send(String::from("foo")); assert_eq!(receiver.await.unwrap(), "foo"); diff --git a/support/mesh/mesh_derive/src/lib.rs b/support/mesh/mesh_derive/src/lib.rs index abbe2656a7..3a9fd0ba44 100644 --- a/support/mesh/mesh_derive/src/lib.rs +++ b/support/mesh/mesh_derive/src/lib.rs @@ -8,19 +8,11 @@ use heck::ToSnakeCase; use proc_macro2::Span; use proc_macro2::TokenStream; +use quote::ToTokens; use quote::format_ident; use quote::quote; use quote::quote_spanned; -use quote::ToTokens; use std::collections::BTreeSet; -use syn::ext::IdentExt; -use syn::parse::Parse; -use syn::parse::ParseStream; -use syn::parse_macro_input; -use syn::parse_quote; -use syn::parse_quote_spanned; -use syn::punctuated::Punctuated; -use syn::spanned::Spanned; use syn::Attribute; use syn::DataEnum; use syn::DataStruct; @@ -38,6 +30,14 @@ use syn::Path; use syn::Token; use syn::TypePath; use syn::WherePredicate; +use syn::ext::IdentExt; +use syn::parse::Parse; +use syn::parse::ParseStream; +use syn::parse_macro_input; +use syn::parse_quote; +use syn::parse_quote_spanned; +use syn::punctuated::Punctuated; +use syn::spanned::Spanned; /// The derive macro for `MeshPayload`. /// @@ -919,7 +919,7 @@ fn derive_enum( }); sizes.push(quote! { - #variant_destructured_ref => { + &mut #variant_destructured_ref => { const NUMBERS: &[u32] = &[#(#field_number,)*]; let entries = const { &[#(<#field_encoding as #protobuf_mod::FieldEncode<#field_types, #resource_type>>::ENTRY.erase(),)*] }; // SAFETY: the fields are in the same object as `self`. diff --git a/support/mesh/mesh_node/src/local_node.rs b/support/mesh/mesh_node/src/local_node.rs index 891da92c03..ba65483f1c 100644 --- a/support/mesh/mesh_node/src/local_node.rs +++ b/support/mesh/mesh_node/src/local_node.rs @@ -11,30 +11,30 @@ use crate::message::OwnedMessage; use crate::resource::OsResource; use crate::resource::Resource; use futures_channel::oneshot; -use mesh_protobuf::buffer::write_with; +use mesh_protobuf::DefaultEncoding; use mesh_protobuf::buffer::Buf; use mesh_protobuf::buffer::Buffer; +use mesh_protobuf::buffer::write_with; use mesh_protobuf::protobuf::Encoder; -use mesh_protobuf::DefaultEncoding; use parking_lot::Mutex; use parking_lot::MutexGuard; use parking_lot::RwLock; use std::any::Any; use std::cmp::Reverse; -use std::collections::hash_map; use std::collections::BinaryHeap; use std::collections::HashMap; use std::collections::VecDeque; +use std::collections::hash_map; use std::fmt; use std::fmt::Debug; use std::fmt::Display; use std::marker::PhantomData; use std::num::Wrapping; +use std::sync::Arc; +use std::sync::Weak; use std::sync::atomic::AtomicBool; use std::sync::atomic::AtomicIsize; use std::sync::atomic::Ordering; -use std::sync::Arc; -use std::sync::Weak; use std::task::Waker; use thiserror::Error; use zerocopy::FromBytes; @@ -303,7 +303,7 @@ impl Port { /// /// Otherwise, this method is more efficient since it can avoid an extra /// allocation to construct a [`Message`]. - pub fn send_protobuf(&self, value: T) + pub fn send_protobuf(&self, mut value: T) where T::Encoding: mesh_protobuf::MessageEncode, { @@ -319,7 +319,7 @@ impl Port { /// /// Otherwise, this method is more efficient since it can avoid an extra /// allocation to construct a [`Message`]. - pub fn send_protobuf_and_close(self, value: T) + pub fn send_protobuf_and_close(self, mut value: T) where T::Encoding: mesh_protobuf::MessageEncode, { @@ -2326,15 +2326,14 @@ pub mod tests { use crate::message::MeshField; use crate::resource::SerializedMessage; use futures::stream::Stream; + use pal_async::DefaultDriver; use pal_async::async_test; use pal_async::task::Spawn; use pal_async::task::Task; - use pal_async::DefaultDriver; use std::future::poll_fn; - use std::future::Future; use std::marker::PhantomData; - use std::pin::pin; use std::pin::Pin; + use std::pin::pin; use std::task::Context; use std::task::Poll; use test_with_tracing::test; diff --git a/support/mesh/mesh_node/src/message.rs b/support/mesh/mesh_node/src/message.rs index 67cb1edae9..ee1280a2ed 100644 --- a/support/mesh/mesh_node/src/message.rs +++ b/support/mesh/mesh_node/src/message.rs @@ -9,15 +9,15 @@ use crate::resource::Resource; use crate::resource::SerializedMessage; use mesh_protobuf; +use mesh_protobuf::DefaultEncoding; +use mesh_protobuf::MessageDecode; +use mesh_protobuf::MessageEncode; use mesh_protobuf::encoding::SerializedMessageEncoder; use mesh_protobuf::inplace; use mesh_protobuf::inplace_none; -use mesh_protobuf::protobuf::decode_with; use mesh_protobuf::protobuf::MessageSizer; use mesh_protobuf::protobuf::MessageWriter; -use mesh_protobuf::DefaultEncoding; -use mesh_protobuf::MessageDecode; -use mesh_protobuf::MessageEncode; +use mesh_protobuf::protobuf::decode_with; use std::any::Any; use std::any::TypeId; use std::borrow::Cow; @@ -321,7 +321,9 @@ impl<'a> Message<'a> { /// # Safety /// The caller must ensure that `message` is initialized. It will be dropped /// in place when the message is dropped, so it must not be used again. - pub(crate) unsafe fn new_stack(message: &'a mut MaybeUninit) -> Self + pub(crate) unsafe fn new_stack( + mut message: MaybeUninit<&'a mut T>, + ) -> Self where T::Encoding: MessageEncode, { @@ -449,7 +451,7 @@ macro_rules! stack_message { #[expect(unsafe_code)] { // SAFETY: The value is initialized and never used again. - unsafe { $crate::message::Message::new_stack(&mut ::core::mem::MaybeUninit::new($v)) } + unsafe { $crate::message::Message::new_stack(::core::mem::MaybeUninit::new(&mut $v)) } } }; } diff --git a/support/mesh/mesh_process/src/lib.rs b/support/mesh/mesh_process/src/lib.rs index e74ba4af6b..3ce2f9b3cc 100644 --- a/support/mesh/mesh_process/src/lib.rs +++ b/support/mesh/mesh_process/src/lib.rs @@ -10,18 +10,18 @@ use anyhow::Context; use base64::Engine; use debug_ptr::DebugPtr; -use futures::executor::block_on; use futures::FutureExt; use futures::StreamExt; +use futures::executor::block_on; use futures_concurrency::future::Race; use inspect::Inspect; use inspect::SensitivityLevel; +use mesh::MeshPayload; +use mesh::OneshotReceiver; use mesh::message::MeshField; use mesh::payload::Protobuf; use mesh::rpc::Rpc; use mesh::rpc::RpcSend; -use mesh::MeshPayload; -use mesh::OneshotReceiver; use mesh_remote::InvitationAddress; #[cfg(unix)] use pal::unix::process::Builder as ProcessBuilder; @@ -29,9 +29,9 @@ use pal::unix::process::Builder as ProcessBuilder; use pal::windows::process; #[cfg(windows)] use pal::windows::process::Builder as ProcessBuilder; +use pal_async::DefaultPool; use pal_async::task::Spawn; use pal_async::task::Task; -use pal_async::DefaultPool; use slab::Slab; use std::borrow::Cow; use std::ffi::OsString; @@ -42,8 +42,8 @@ use std::os::unix::prelude::*; use std::os::windows::prelude::*; use std::path::PathBuf; use std::thread; -use tracing::instrument; use tracing::Instrument; +use tracing::instrument; use unicycle::FuturesUnordered; #[cfg(windows)] @@ -159,8 +159,10 @@ async fn node_from_environment() -> anyhow::Result> { // current edition), either this function and its callers need to become // `unsafe`, or we need to avoid using the environment to propagate the // invitation so that we can avoid this call. - #[expect(deprecated_safe_2024)] - std::env::remove_var(INVITATION_ENV_NAME); + // SAFETY: TODO + unsafe { + std::env::remove_var(INVITATION_ENV_NAME); + } let invitation: Invitation = mesh::payload::decode( &base64::engine::general_purpose::STANDARD diff --git a/support/mesh/mesh_remote/src/alpc_node.rs b/support/mesh/mesh_remote/src/alpc_node.rs index c7ef9da844..fbf8425f8e 100644 --- a/support/mesh/mesh_remote/src/alpc_node.rs +++ b/support/mesh/mesh_remote/src/alpc_node.rs @@ -9,11 +9,11 @@ use crate::common::InvitationAddress; use crate::protocol; -use futures::channel::mpsc; -use futures::future::abortable; -use futures::future::AbortHandle; use futures::FutureExt; use futures::StreamExt; +use futures::channel::mpsc; +use futures::future::AbortHandle; +use futures::future::abortable; use mesh_node::common::Address; use mesh_node::common::NodeId; use mesh_node::common::PortId; @@ -26,17 +26,17 @@ use mesh_node::local_node::RemoteNodeHandle; use mesh_node::local_node::SendEvent; use mesh_node::resource::OsResource; use mesh_node::resource::Resource; -use mesh_protobuf::buffer::Buffer; use mesh_protobuf::Protobuf; +use mesh_protobuf::buffer::Buffer; use ntapi::ntobapi::DIRECTORY_ALL_ACCESS; -use pal::windows::alpc; -use pal::windows::alpc::PortSection; -use pal::windows::alpc::SendMessage; -use pal::windows::create_object_directory; use pal::windows::BorrowedHandleExt; use pal::windows::ObjectAttributes; use pal::windows::OwnedSocketExt; use pal::windows::UnicodeString; +use pal::windows::alpc; +use pal::windows::alpc::PortSection; +use pal::windows::alpc::SendMessage; +use pal::windows::create_object_directory; use pal_async::driver::Driver; use pal_async::task::Spawn; use pal_async::task::Task; @@ -44,7 +44,6 @@ use pal_async::wait::PolledWait; use parking_lot::Mutex; use std::collections::HashMap; use std::fmt::Debug; -use std::future::Future; use std::io; use std::ops::Deref; use std::os::windows::prelude::*; @@ -780,10 +779,10 @@ impl Deref for AlpcPort { #[cfg(test)] mod tests { use super::AlpcNode; - use mesh_channel::channel; use mesh_channel::RecvError; - use pal_async::async_test; + use mesh_channel::channel; use pal_async::DefaultDriver; + use pal_async::async_test; use pal_event::Event; use std::io::Read; use std::io::Write; diff --git a/support/mesh/mesh_remote/src/unix_node.rs b/support/mesh/mesh_remote/src/unix_node.rs index 3e92ff2ae2..ba7aadf7ab 100644 --- a/support/mesh/mesh_remote/src/unix_node.rs +++ b/support/mesh/mesh_remote/src/unix_node.rs @@ -21,17 +21,17 @@ mod memfd; use crate::common::InvitationAddress; use crate::protocol; +use futures::FutureExt; +use futures::StreamExt; use futures::channel::mpsc; use futures::future; use futures::future::BoxFuture; -use futures::FutureExt; -use futures::StreamExt; use io::ErrorKind; -use mesh_channel::channel; -use mesh_channel::oneshot; use mesh_channel::OneshotReceiver; use mesh_channel::OneshotSender; use mesh_channel::RecvError; +use mesh_channel::channel; +use mesh_channel::oneshot; use mesh_node::common::Address; use mesh_node::common::NodeId; use mesh_node::common::PortId; @@ -56,7 +56,6 @@ use std::collections::HashMap; use std::collections::VecDeque; use std::fmt::Debug; use std::future::poll_fn; -use std::future::Future; use std::io; use std::io::IoSlice; use std::io::IoSliceMut; @@ -539,30 +538,34 @@ async fn run_connection( handle: RemoteNodeHandle, ) { let mut retained_fds = VecDeque::new(); - let mut recv = pin!(async { - let r = run_receive(&local_node, &remote_id, &socket, &send_send).await; - match &r { - Ok(_) => { - tracing::debug!("incoming socket disconnected"); - } - Err(err) => { - tracing::error!(error = err as &dyn std::error::Error, "error receiving"); + let mut recv = pin!( + async { + let r = run_receive(&local_node, &remote_id, &socket, &send_send).await; + match &r { + Ok(_) => { + tracing::debug!("incoming socket disconnected"); + } + Err(err) => { + tracing::error!(error = err as &dyn std::error::Error, "error receiving"); + } } + r } - r - } - .fuse()); - let mut send = pin!(async { - match run_send(send_recv, &socket, &mut retained_fds).await { - Ok(_) => { - tracing::debug!("sending is done"); - } - Err(err) => { - tracing::error!(error = &err as &dyn std::error::Error, "failed send"); + .fuse() + ); + let mut send = pin!( + async { + match run_send(send_recv, &socket, &mut retained_fds).await { + Ok(_) => { + tracing::debug!("sending is done"); + } + Err(err) => { + tracing::error!(error = &err as &dyn std::error::Error, "failed send"); + } } } - } - .fuse()); + .fuse() + ); let r = futures::select! { // race semantics r = recv => { // Notify the remote node that no more data will be sent. @@ -1288,10 +1291,10 @@ fn set_cloexec(fd: impl AsFd) { #[cfg(test)] mod tests { use crate::unix::UnixNode; - use mesh_channel::channel; use mesh_channel::RecvError; - use pal_async::async_test; + use mesh_channel::channel; use pal_async::DefaultDriver; + use pal_async::async_test; use test_with_tracing::test; #[async_test] diff --git a/support/mesh/mesh_rpc/src/client.rs b/support/mesh/mesh_rpc/src/client.rs index 0796a1d2e2..0c6c9511c6 100644 --- a/support/mesh/mesh_rpc/src/client.rs +++ b/support/mesh/mesh_rpc/src/client.rs @@ -3,16 +3,16 @@ //! TTRPC client. -use crate::message::read_message; -use crate::message::write_message; +use crate::message::MESSAGE_TYPE_REQUEST; +use crate::message::MESSAGE_TYPE_RESPONSE; use crate::message::ReadResult; use crate::message::Request; use crate::message::Response; use crate::message::TooLongError; -use crate::message::MESSAGE_TYPE_REQUEST; -use crate::message::MESSAGE_TYPE_RESPONSE; -use crate::rpc::status_from_err; +use crate::message::read_message; +use crate::message::write_message; use crate::rpc::ProtocolError; +use crate::rpc::status_from_err; use crate::service::Code; use crate::service::DecodedRpc; use crate::service::GenericRpc; @@ -25,10 +25,10 @@ use futures::AsyncWrite; use futures::FutureExt; use futures::StreamExt; use futures_concurrency::future::Race; -use mesh::payload::EncodeAs; -use mesh::payload::Timestamp; use mesh::Deadline; use mesh::MeshPayload; +use mesh::payload::EncodeAs; +use mesh::payload::Timestamp; use pal_async::driver::Driver; use pal_async::socket::PolledSocket; use pal_async::task::Spawn; @@ -39,7 +39,6 @@ use parking_lot::Mutex; use std::collections::HashMap; use std::collections::VecDeque; use std::future::pending; -use std::future::Future; use std::pin::pin; use std::task::ready; use std::time::Duration; @@ -503,9 +502,9 @@ mod tests { use crate::service::Code; use mesh::CancelContext; use mesh::Deadline; + use pal_async::DefaultDriver; use pal_async::async_test; use pal_async::socket::PolledSocket; - use pal_async::DefaultDriver; use std::future::pending; use std::net::TcpStream; use std::time::Duration; diff --git a/support/mesh_tracing/src/lib.rs b/support/mesh_tracing/src/lib.rs index d28a37cab1..f63430feb7 100644 --- a/support/mesh_tracing/src/lib.rs +++ b/support/mesh_tracing/src/lib.rs @@ -7,30 +7,29 @@ mod bounded; -use self::bounded::bounded; use self::bounded::BoundedReceiver; use self::bounded::BoundedSender; +use self::bounded::bounded; use anyhow::Context as _; -use futures::future::join_all; use futures::FutureExt; use futures::Stream; +use futures::future::join_all; use guid::Guid; use inspect::InspectMut; +use mesh::MeshPayload; use mesh::rpc::Rpc; use mesh::rpc::RpcSend; -use mesh::MeshPayload; use pal_async::task::Spawn; use pal_async::task::Task; use std::fs::File; -use std::future::Future; use std::pin::Pin; use std::task::Context; use std::task::Poll; +use tracing_subscriber::Layer; use tracing_subscriber::filter::Filtered; use tracing_subscriber::filter::Targets; use tracing_subscriber::registry::LookupSpan; use tracing_subscriber::reload; -use tracing_subscriber::Layer; #[derive(Debug, MeshPayload)] pub struct RemoteTracer { diff --git a/support/pal/pal_async/src/io_pool.rs b/support/pal/pal_async/src/io_pool.rs index 029f788283..018af2508a 100644 --- a/support/pal/pal_async/src/io_pool.rs +++ b/support/pal/pal_async/src/io_pool.rs @@ -3,14 +3,13 @@ //! Single-threaded task pools backed by platform-specific IO backends. -use crate::task::task_queue; use crate::task::Schedule; use crate::task::Scheduler; use crate::task::Spawn; use crate::task::TaskMetadata; use crate::task::TaskQueue; +use crate::task::task_queue; use std::future::poll_fn; -use std::future::Future; use std::pin::pin; use std::sync::Arc; use std::task::Poll; diff --git a/support/pal/pal_async/src/local.rs b/support/pal/pal_async/src/local.rs index e13272ce42..abc97f5826 100644 --- a/support/pal/pal_async/src/local.rs +++ b/support/pal/pal_async/src/local.rs @@ -11,15 +11,14 @@ use crate::timer::TimerDriver; use crate::timer::TimerQueue; use crate::timer::TimerResult; use crate::waker::WakerList; -use futures::task::waker_ref; use futures::task::ArcWake; +use futures::task::waker_ref; use parking_lot::Condvar; use parking_lot::MappedMutexGuard; use parking_lot::Mutex; use parking_lot::MutexGuard; -use std::future::Future; -use std::pin::pin; use std::pin::Pin; +use std::pin::pin; use std::sync::Arc; use std::task::Context; use std::task::Poll; diff --git a/support/pal/pal_async/src/socket.rs b/support/pal/pal_async/src/socket.rs index 4ebd516733..bffbf518e9 100644 --- a/support/pal/pal_async/src/socket.rs +++ b/support/pal/pal_async/src/socket.rs @@ -14,7 +14,6 @@ use futures::AsyncWrite; use parking_lot::Mutex; use std::fmt::Debug; use std::future::poll_fn; -use std::future::Future; use std::io; use std::io::Read; use std::io::Write; diff --git a/support/pal/pal_async/src/task.rs b/support/pal/pal_async/src/task.rs index 1f408967e6..f0adb31e3f 100644 --- a/support/pal/pal_async/src/task.rs +++ b/support/pal/pal_async/src/task.rs @@ -11,15 +11,14 @@ use parking_lot::Mutex; use slab::Slab; use std::fmt::Debug; use std::fmt::Display; -use std::future::Future; use std::panic::Location; use std::pin::Pin; +use std::sync::Arc; +use std::sync::Weak; use std::sync::atomic::AtomicBool; use std::sync::atomic::AtomicU32; use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering; -use std::sync::Arc; -use std::sync::Weak; /// A handle to a task. pub type Task = async_task::Task; diff --git a/support/pal/pal_async/src/timer.rs b/support/pal/pal_async/src/timer.rs index 7d59f73c87..1d3e823053 100644 --- a/support/pal/pal_async/src/timer.rs +++ b/support/pal/pal_async/src/timer.rs @@ -7,7 +7,6 @@ use crate::driver::Driver; use crate::driver::PollImpl; use crate::sparsevec::SparseVec; use crate::waker::WakerList; -use std::future::Future; use std::pin::Pin; use std::task::Context; use std::task::Poll; diff --git a/support/pal/pal_async/src/unix/epoll.rs b/support/pal/pal_async/src/unix/epoll.rs index 505630f000..4f2abcf3c9 100644 --- a/support/pal/pal_async/src/unix/epoll.rs +++ b/support/pal/pal_async/src/unix/epoll.rs @@ -29,7 +29,6 @@ use pal::unix::SyscallResult; use pal_event::Event; use parking_lot::Mutex; use std::fs::File; -use std::future::Future; use std::io; use std::os::unix::prelude::*; use std::pin::pin; diff --git a/support/pal/pal_async/src/unix/kqueue.rs b/support/pal/pal_async/src/unix/kqueue.rs index abee728b59..2d4a5f987e 100644 --- a/support/pal/pal_async/src/unix/kqueue.rs +++ b/support/pal/pal_async/src/unix/kqueue.rs @@ -28,7 +28,6 @@ use pal::unix::Errno; use pal::unix::SyscallResult; use parking_lot::Mutex; use std::fs::File; -use std::future::Future; use std::io; use std::os::unix::prelude::*; use std::pin::pin; diff --git a/support/pal/pal_async/src/wait.rs b/support/pal/pal_async/src/wait.rs index 6998de42f9..3c33451903 100644 --- a/support/pal/pal_async/src/wait.rs +++ b/support/pal/pal_async/src/wait.rs @@ -7,7 +7,6 @@ use crate::any::AsAny; use crate::driver::Driver; use crate::driver::PollImpl; use std::future::poll_fn; -use std::future::Future; use std::io; #[cfg(unix)] use std::os::unix::prelude::*; diff --git a/support/pal/pal_async/src/windows/iocp.rs b/support/pal/pal_async/src/windows/iocp.rs index 0fa4561ff4..db50bfe712 100644 --- a/support/pal/pal_async/src/windows/iocp.rs +++ b/support/pal/pal_async/src/windows/iocp.rs @@ -24,20 +24,19 @@ use crate::timer::TimerResult; use crate::wait::PollWait; use crate::wait::WaitDriver; use crate::waker::WakerList; -use futures::task::waker_ref; -use futures::task::ArcWake; use futures::FutureExt; +use futures::task::ArcWake; +use futures::task::waker_ref; use once_cell::sync::OnceCell; -use pal::windows::afd; -use pal::windows::disassociate_completion_port; -use pal::windows::set_file_completion_notification_modes; use pal::windows::IoCompletionPort; use pal::windows::Overlapped; use pal::windows::SendSyncRawHandle; use pal::windows::WaitPacket; +use pal::windows::afd; +use pal::windows::disassociate_completion_port; +use pal::windows::set_file_completion_notification_modes; use parking_lot::Mutex; use std::fs::File; -use std::future::Future; use std::io; use std::os::windows::prelude::*; use std::pin::pin; diff --git a/support/pal/pal_async/src/windows/overlapped.rs b/support/pal/pal_async/src/windows/overlapped.rs index dc889dfb84..c914cba582 100644 --- a/support/pal/pal_async/src/windows/overlapped.rs +++ b/support/pal/pal_async/src/windows/overlapped.rs @@ -6,12 +6,11 @@ use crate::driver::Driver; use crate::driver::PollImpl; use crate::waker::WakerList; -use pal::windows::chk_status; use pal::windows::Overlapped; use pal::windows::SendSyncRawHandle; +use pal::windows::chk_status; use parking_lot::Mutex; use std::fs::File; -use std::future::Future; use std::io; use std::mem::ManuallyDrop; use std::os::windows::prelude::*; diff --git a/support/pal/pal_async/src/windows/pipe.rs b/support/pal/pal_async/src/windows/pipe.rs index bed8bce513..d1f54be614 100644 --- a/support/pal/pal_async/src/windows/pipe.rs +++ b/support/pal/pal_async/src/windows/pipe.rs @@ -23,7 +23,6 @@ use pal::windows::pipe::FILE_PIPE_WRITE_READY; use pal::windows::Overlapped; use pal_event::Event; use std::fs::File; -use std::future::Future; use std::io; use std::io::Write; use std::os::windows::prelude::*; diff --git a/support/pal/pal_uring/src/threadpool.rs b/support/pal/pal_uring/src/threadpool.rs index 802b4f5f96..57766fc7a1 100644 --- a/support/pal/pal_uring/src/threadpool.rs +++ b/support/pal/pal_uring/src/threadpool.rs @@ -32,11 +32,10 @@ use std::cell::Cell; use std::cell::RefCell; use std::fmt::Debug; use std::future::poll_fn; -use std::future::Future; use std::io; use std::os::unix::prelude::*; -use std::pin::pin; use std::pin::Pin; +use std::pin::pin; use std::process::abort; use std::sync::Arc; use std::task::Context; @@ -624,7 +623,6 @@ mod tests { use io_uring::types; use pal_async::task::Spawn; use parking_lot::Mutex; - use std::future::Future; use std::os::unix::prelude::*; use std::pin::Pin; use std::sync::Arc; diff --git a/support/pal/pal_uring/src/uring.rs b/support/pal/pal_uring/src/uring.rs index 18cc193f57..ff645a80e0 100644 --- a/support/pal/pal_uring/src/uring.rs +++ b/support/pal/pal_uring/src/uring.rs @@ -17,9 +17,9 @@ use pal_async::interest::SLOT_COUNT; use pal_async::timer::Instant; use pal_async::timer::PollTimer; use pal_async::timer::TimerDriver; +use pal_async::wait::MAXIMUM_WAIT_READ_SIZE; use pal_async::wait::PollWait; use pal_async::wait::WaitDriver; -use pal_async::wait::MAXIMUM_WAIT_READ_SIZE; use std::fmt::Debug; use std::io; use std::os::unix::prelude::*; @@ -391,7 +391,6 @@ pub(crate) mod tests { use once_cell::sync::OnceCell; use pal_async::executor_tests; use pal_async::task::Spawn; - use std::future::Future; use std::io; use std::thread::JoinHandle; diff --git a/support/task_control/src/lib.rs b/support/task_control/src/lib.rs index 8d77b08a55..81c79e3490 100644 --- a/support/task_control/src/lib.rs +++ b/support/task_control/src/lib.rs @@ -13,9 +13,8 @@ use pal_async::task::Spawn; use pal_async::task::Task; use parking_lot::Mutex; use std::future::poll_fn; -use std::future::Future; -use std::pin::pin; use std::pin::Pin; +use std::pin::pin; use std::sync::Arc; use std::task::Context; use std::task::Poll; @@ -94,9 +93,10 @@ impl StopTask<'_> { pub async fn until_stopped(&mut self, fut: F) -> Result { // Wrap the cancel task in a FastSelect to avoid taking the channel lock // at each wakeup. - let mut cancel = pin!(self - .fast_select - .select((poll_fn(|cx| self.inner.poll_ready(cx)),))); + let mut cancel = pin!( + self.fast_select + .select((poll_fn(|cx| self.inner.poll_ready(cx)),)) + ); let mut fut = pin!(fut); @@ -574,8 +574,8 @@ mod tests { use crate::StopTask; use crate::TaskControl; use futures::FutureExt; - use pal_async::async_test; use pal_async::DefaultDriver; + use pal_async::async_test; use std::task::Poll; struct Foo(u32); diff --git a/support/uevent/src/lib.rs b/support/uevent/src/lib.rs index 71f68ccf8f..3966526ca7 100644 --- a/support/uevent/src/lib.rs +++ b/support/uevent/src/lib.rs @@ -22,7 +22,6 @@ use pal_async::driver::SpawnDriver; use pal_async::socket::PolledSocket; use pal_async::task::Task; use socket2::Socket; -use std::future::Future; use std::io; use std::path::Path; use std::path::PathBuf; diff --git a/vm/aarch64/aarch64emu/src/cpu.rs b/vm/aarch64/aarch64emu/src/cpu.rs index bc905a7bcc..839a83d58c 100644 --- a/vm/aarch64/aarch64emu/src/cpu.rs +++ b/vm/aarch64/aarch64emu/src/cpu.rs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -use std::future::Future; pub trait Cpu: AccessCpuState { /// The error type for IO access failures. diff --git a/vm/chipset_device/src/io/deferred.rs b/vm/chipset_device/src/io/deferred.rs index 086fcbd1f5..4f7495bffb 100644 --- a/vm/chipset_device/src/io/deferred.rs +++ b/vm/chipset_device/src/io/deferred.rs @@ -28,7 +28,6 @@ //! } //! ``` -use std::future::Future; use std::pin::Pin; use std::task::ready; use std::task::Context; diff --git a/vm/devices/get/guest_emulation_transport/src/process_loop.rs b/vm/devices/get/guest_emulation_transport/src/process_loop.rs index 3b38cb11f2..01cc2923b2 100644 --- a/vm/devices/get/guest_emulation_transport/src/process_loop.rs +++ b/vm/devices/get/guest_emulation_transport/src/process_loop.rs @@ -28,7 +28,6 @@ use std::cmp::min; use std::collections::HashMap; use std::collections::VecDeque; use std::future::pending; -use std::future::Future; use std::pin::Pin; use std::sync::Arc; use thiserror::Error; diff --git a/vm/devices/input_core/src/lib.rs b/vm/devices/input_core/src/lib.rs index 0042a86ff6..cd7877b9aa 100644 --- a/vm/devices/input_core/src/lib.rs +++ b/vm/devices/input_core/src/lib.rs @@ -9,10 +9,10 @@ pub mod mesh_input; use mesh::MeshPayload; use std::pin::Pin; -use vm_resource::kind::KeyboardInputHandleKind; -use vm_resource::kind::MouseInputHandleKind; use vm_resource::CanResolveTo; use vm_resource::ResourceId; +use vm_resource::kind::KeyboardInputHandleKind; +use vm_resource::kind::MouseInputHandleKind; /// Keyboard or mouse input data. #[derive(Debug, Copy, Clone, MeshPayload)] @@ -47,10 +47,7 @@ pub struct KeyboardData { pub trait InputSource: futures::Stream + Unpin + Send { /// Sets this input source active, so that the sending side can choose which /// device to send input to. - fn set_active( - &mut self, - active: bool, - ) -> Pin + Send>>; + fn set_active(&mut self, active: bool) -> Pin + Send>>; } /// A resolved [`InputSource`]. diff --git a/vm/devices/input_core/src/mesh_input.rs b/vm/devices/input_core/src/mesh_input.rs index f486d75d1d..9ce157a361 100644 --- a/vm/devices/input_core/src/mesh_input.rs +++ b/vm/devices/input_core/src/mesh_input.rs @@ -20,7 +20,7 @@ impl InputSource for MeshInputSource { fn set_active( &mut self, active: bool, - ) -> Pin + Send>> { + ) -> Pin + Send>> { Box::pin(async move { if *self.active.get() != active { self.active.set(active).await; diff --git a/vm/devices/serial/vmbus_serial_host/src/lib.rs b/vm/devices/serial/vmbus_serial_host/src/lib.rs index 7a5cf8ef7d..10f0e53f88 100644 --- a/vm/devices/serial/vmbus_serial_host/src/lib.rs +++ b/vm/devices/serial/vmbus_serial_host/src/lib.rs @@ -16,7 +16,6 @@ use std::cmp::min; use std::collections::VecDeque; use std::fmt::Debug; use std::future::poll_fn; -use std::future::Future; use std::pin::pin; use std::pin::Pin; use std::task::ready; diff --git a/vm/devices/storage/disk_backend/src/lib.rs b/vm/devices/storage/disk_backend/src/lib.rs index 1220635008..ff29cc6743 100644 --- a/vm/devices/storage/disk_backend/src/lib.rs +++ b/vm/devices/storage/disk_backend/src/lib.rs @@ -21,7 +21,6 @@ use scsi_buffers::RequestBuffers; use stackfuture::StackFuture; use std::fmt::Debug; use std::future::ready; -use std::future::Future; use std::pin::Pin; use std::sync::Arc; use thiserror::Error; diff --git a/vm/devices/storage/disk_crypt/src/lib.rs b/vm/devices/storage/disk_crypt/src/lib.rs index b9f4eb0d6d..51d889eb7d 100644 --- a/vm/devices/storage/disk_crypt/src/lib.rs +++ b/vm/devices/storage/disk_crypt/src/lib.rs @@ -167,7 +167,7 @@ impl DiskIo for CryptDisk { sector: u64, count: u64, block_level_only: bool, - ) -> impl std::future::Future> + Send { + ) -> impl Future> + Send { self.inner.unmap(sector, count, block_level_only) } diff --git a/vm/devices/storage/disk_layered/src/lib.rs b/vm/devices/storage/disk_layered/src/lib.rs index 6ae0f4e110..3a4271de38 100644 --- a/vm/devices/storage/disk_layered/src/lib.rs +++ b/vm/devices/storage/disk_layered/src/lib.rs @@ -40,7 +40,6 @@ use inspect::Inspect; use scsi_buffers::OwnedRequestBuffers; use scsi_buffers::RequestBuffers; use std::convert::Infallible; -use std::future::Future; use std::pin::Pin; use thiserror::Error; diff --git a/vm/devices/storage/disk_nvme/nvme_driver/src/driver.rs b/vm/devices/storage/disk_nvme/nvme_driver/src/driver.rs index f421a9d182..c03ef55411 100644 --- a/vm/devices/storage/disk_nvme/nvme_driver/src/driver.rs +++ b/vm/devices/storage/disk_nvme/nvme_driver/src/driver.rs @@ -455,7 +455,7 @@ impl NvmeDriver { drop(self); } - fn reset(&mut self) -> impl Send + std::future::Future + use { + fn reset(&mut self) -> impl Send + Future + use { let driver = self.driver.clone(); let mut task = std::mem::take(&mut self.task).unwrap(); async move { diff --git a/vm/devices/storage/disk_prwrap/src/lib.rs b/vm/devices/storage/disk_prwrap/src/lib.rs index aff5f8f4c8..24de4ac677 100644 --- a/vm/devices/storage/disk_prwrap/src/lib.rs +++ b/vm/devices/storage/disk_prwrap/src/lib.rs @@ -21,7 +21,6 @@ use disk_backend_resources::DiskWithReservationsHandle; use inspect::Inspect; use parking_lot::Mutex; use scsi_buffers::RequestBuffers; -use std::future::Future; use std::num::NonZeroU64; use std::num::Wrapping; use thiserror::Error; diff --git a/vm/devices/storage/disk_striped/src/lib.rs b/vm/devices/storage/disk_striped/src/lib.rs index f72edb4fb1..62fc2d85dc 100644 --- a/vm/devices/storage/disk_striped/src/lib.rs +++ b/vm/devices/storage/disk_striped/src/lib.rs @@ -8,12 +8,12 @@ #![forbid(unsafe_code)] use async_trait::async_trait; -use disk_backend::resolve::ResolveDiskParameters; -use disk_backend::resolve::ResolvedDisk; use disk_backend::Disk; use disk_backend::DiskError; use disk_backend::DiskIo; use disk_backend::UnmapBehavior; +use disk_backend::resolve::ResolveDiskParameters; +use disk_backend::resolve::ResolvedDisk; use disk_backend_resources::StripedDiskHandle; use futures::future::join_all; use futures::future::try_join_all; @@ -21,10 +21,10 @@ use inspect::Inspect; use scsi_buffers::RequestBuffers; use std::fmt::Debug; use thiserror::Error; -use vm_resource::declare_static_async_resolver; -use vm_resource::kind::DiskHandleKind; use vm_resource::AsyncResolveResource; use vm_resource::ResourceResolver; +use vm_resource::declare_static_async_resolver; +use vm_resource::kind::DiskHandleKind; pub struct StripedDiskResolver; declare_static_async_resolver!(StripedDiskResolver, (DiskHandleKind, StripedDiskHandle)); @@ -72,7 +72,9 @@ const CHUNK_SIZE_128K: u32 = 128 * 1024; pub enum NewDeviceError { #[error("Can't create a striping disk since the input device list is empty")] EmptyDeviceList, - #[error("The files are not compatible to form a striping disk: sector_size-{sector_size} != cur_sector_size-{cur_sector_size} OR sector_count-{sector_count} != cur_sector_count-{cur_sector_count}")] + #[error( + "The files are not compatible to form a striping disk: sector_size-{sector_size} != cur_sector_size-{cur_sector_size} OR sector_count-{sector_count} != cur_sector_count-{cur_sector_count}" + )] DeviceNotCompatible { sector_size: u32, cur_sector_size: u32, @@ -547,7 +549,7 @@ impl DiskIo for StripedDisk { async fn await_all_and_check(futures: T) -> Result<(), E> where T: IntoIterator, - T::Item: core::future::Future>, + T::Item: Future>, { // Use join_all to wait for all IOs even if one fails. This is necessary to // avoid dropping IOs while they are in flight. diff --git a/vm/devices/storage/floppy/src/lib.rs b/vm/devices/storage/floppy/src/lib.rs index 64fcb1bf9e..5978a88ccf 100644 --- a/vm/devices/storage/floppy/src/lib.rs +++ b/vm/devices/storage/floppy/src/lib.rs @@ -50,7 +50,6 @@ use guestmem::GuestMemory; use inspect::Inspect; use inspect::InspectMut; use scsi_buffers::RequestBuffers; -use std::future::Future; use std::pin::Pin; use std::sync::Arc; use std::task::Context; diff --git a/vm/devices/storage/ide/src/drive/atapi_drive.rs b/vm/devices/storage/ide/src/drive/atapi_drive.rs index 9af8fcaa9b..9533c17d67 100644 --- a/vm/devices/storage/ide/src/drive/atapi_drive.rs +++ b/vm/devices/storage/ide/src/drive/atapi_drive.rs @@ -23,7 +23,6 @@ use scsi_buffers::RequestBuffers; use scsi_core::AsyncScsiDisk; use scsi_core::ScsiResult; use scsi_defs as scsi; -use std::future::Future; use std::pin::Pin; use std::sync::Arc; use std::task::Context; diff --git a/vm/devices/storage/ide/src/drive/hard_drive.rs b/vm/devices/storage/ide/src/drive/hard_drive.rs index 597c29ab0c..98f869b1b6 100644 --- a/vm/devices/storage/ide/src/drive/hard_drive.rs +++ b/vm/devices/storage/ide/src/drive/hard_drive.rs @@ -22,7 +22,6 @@ use ide_resources::IdePath; use inspect::Inspect; use safeatomic::AtomicSliceOps; use scsi_buffers::RequestBuffers; -use std::future::Future; use std::pin::Pin; use std::sync::Arc; use std::task::Context; diff --git a/vm/devices/storage/nvme/src/workers/io.rs b/vm/devices/storage/nvme/src/workers/io.rs index 1650069c6a..6b4b854bc3 100644 --- a/vm/devices/storage/nvme/src/workers/io.rs +++ b/vm/devices/storage/nvme/src/workers/io.rs @@ -19,7 +19,6 @@ use guestmem::GuestMemory; use inspect::Inspect; use std::collections::BTreeMap; use std::future::pending; -use std::future::Future; use std::pin::Pin; use std::sync::Arc; use task_control::AsyncRun; diff --git a/vm/devices/storage/storvsp/benches/ioperf.rs b/vm/devices/storage/storvsp/benches/ioperf.rs index 61693c09df..d07a8b3d3f 100644 --- a/vm/devices/storage/storvsp/benches/ioperf.rs +++ b/vm/devices/storage/storvsp/benches/ioperf.rs @@ -17,7 +17,7 @@ use std::cell::RefCell; struct WrappedExecutor(RefCell); impl AsyncExecutor for &'_ WrappedExecutor { - fn block_on(&self, future: impl std::future::Future) -> T { + fn block_on(&self, future: impl Future) -> T { self.0.borrow_mut().run_until(future) } } diff --git a/vm/devices/storage/storvsp/src/lib.rs b/vm/devices/storage/storvsp/src/lib.rs index 47be94e682..ddd981a610 100644 --- a/vm/devices/storage/storvsp/src/lib.rs +++ b/vm/devices/storage/storvsp/src/lib.rs @@ -59,7 +59,6 @@ use std::collections::hash_map::Entry; use std::collections::hash_map::HashMap; use std::fmt::Debug; use std::future::poll_fn; -use std::future::Future; use std::pin::Pin; use std::sync::Arc; use std::task::Context; diff --git a/vm/devices/tpm/src/lib.rs b/vm/devices/tpm/src/lib.rs index 2bac32581e..923fb50bc1 100644 --- a/vm/devices/tpm/src/lib.rs +++ b/vm/devices/tpm/src/lib.rs @@ -30,7 +30,6 @@ use inspect::Inspect; use inspect::InspectMut; use ms_tpm_20_ref::MsTpm20RefPlatform; use parking_lot::Mutex; -use std::future::Future; use std::ops::RangeInclusive; use std::pin::Pin; use std::sync::Arc; diff --git a/vm/devices/user_driver/src/backoff.rs b/vm/devices/user_driver/src/backoff.rs index 239f072f84..977a8a2bfc 100644 --- a/vm/devices/user_driver/src/backoff.rs +++ b/vm/devices/user_driver/src/backoff.rs @@ -5,7 +5,6 @@ use pal_async::driver::Driver; use pal_async::timer::PolledTimer; -use std::future::Future; use std::pin::Pin; use std::task::Context; use std::task::Poll; diff --git a/vm/devices/vga_proxy/src/lib.rs b/vm/devices/vga_proxy/src/lib.rs index b67dab51c1..16ae07dea9 100644 --- a/vm/devices/vga_proxy/src/lib.rs +++ b/vm/devices/vga_proxy/src/lib.rs @@ -16,7 +16,6 @@ use chipset_device::pio::PortIoIntercept; use chipset_device::poll_device::PollDevice; use chipset_device::ChipsetDevice; use inspect::InspectMut; -use std::future::Future; use std::ops::RangeInclusive; use std::pin::Pin; use std::sync::Arc; diff --git a/vm/devices/vmbus/vmbus_async/src/async_dgram.rs b/vm/devices/vmbus/vmbus_async/src/async_dgram.rs index a7f4e292bb..e4e13e9171 100644 --- a/vm/devices/vmbus/vmbus_async/src/async_dgram.rs +++ b/vm/devices/vmbus/vmbus_async/src/async_dgram.rs @@ -11,7 +11,6 @@ //! [`futures::AsyncRead`]), where one send can be split into multiple receives, //! or multiple sends can be combined into one receive. -use std::future::Future; use std::io; use std::io::IoSlice; use std::io::IoSliceMut; diff --git a/vm/devices/vmbus/vmbus_async/src/queue.rs b/vm/devices/vmbus/vmbus_async/src/queue.rs index 85a701b7ed..5b63b91ffa 100644 --- a/vm/devices/vmbus/vmbus_async/src/queue.rs +++ b/vm/devices/vmbus/vmbus_async/src/queue.rs @@ -18,7 +18,6 @@ use ring::OutgoingPacketType; use ring::TransferPageRange; use smallvec::smallvec; use std::future::poll_fn; -use std::future::Future; use std::ops::Deref; use std::task::ready; use std::task::Context; diff --git a/vm/devices/vmbus/vmbus_client/src/lib.rs b/vm/devices/vmbus/vmbus_client/src/lib.rs index a8ba64aae2..aaf7313335 100644 --- a/vm/devices/vmbus/vmbus_client/src/lib.rs +++ b/vm/devices/vmbus/vmbus_client/src/lib.rs @@ -26,7 +26,6 @@ use std::collections::HashMap; use std::collections::VecDeque; use std::convert::TryInto; use std::future::poll_fn; -use std::future::Future; use std::pin::pin; use std::sync::Arc; use std::task::ready; diff --git a/vm/devices/vmbus/vmbus_core/src/lib.rs b/vm/devices/vmbus/vmbus_core/src/lib.rs index 5eb8cee592..34265b5dbb 100644 --- a/vm/devices/vmbus/vmbus_core/src/lib.rs +++ b/vm/devices/vmbus/vmbus_core/src/lib.rs @@ -14,7 +14,6 @@ use protocol::MessageHeader; use protocol::VmbusMessage; use protocol::HEADER_SIZE; use protocol::MAX_MESSAGE_SIZE; -use std::future::Future; use std::str::FromStr; use std::task::Poll; use thiserror::Error; diff --git a/vm/devices/vmbus/vmbus_relay/src/lib.rs b/vm/devices/vmbus/vmbus_relay/src/lib.rs index f1458b3604..0ad8acb38d 100644 --- a/vm/devices/vmbus/vmbus_relay/src/lib.rs +++ b/vm/devices/vmbus/vmbus_relay/src/lib.rs @@ -37,7 +37,6 @@ use pal_async::task::Task; use pal_event::Event; use std::collections::HashMap; use std::fmt::Debug; -use std::future::Future; use std::pin::Pin; use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; diff --git a/vm/devices/vmbus/vmbus_relay_intercept_device/src/lib.rs b/vm/devices/vmbus/vmbus_relay_intercept_device/src/lib.rs index 48dcee67c0..22c5a12590 100644 --- a/vm/devices/vmbus/vmbus_relay_intercept_device/src/lib.rs +++ b/vm/devices/vmbus/vmbus_relay_intercept_device/src/lib.rs @@ -23,7 +23,6 @@ use inspect::InspectMut; use mesh::rpc::RpcSend; use pal_async::driver::SpawnDriver; use std::future::pending; -use std::future::Future; use std::pin::pin; use std::sync::Arc; use task_control::AsyncRun; diff --git a/vm/devices/vmbus/vmbus_server/src/hvsock.rs b/vm/devices/vmbus/vmbus_server/src/hvsock.rs index 2fbbd4535c..b76e8c49d7 100644 --- a/vm/devices/vmbus/vmbus_server/src/hvsock.rs +++ b/vm/devices/vmbus/vmbus_server/src/hvsock.rs @@ -113,7 +113,7 @@ impl HvsockRelay { &self, ctx: &mut CancelContext, service_id: Guid, - ) -> impl std::future::Future> + Send + use<> { + ) -> impl Future> + Send + use<> { let inner = self.inner.clone(); let host_send = self.host_send.clone(); let (send, recv) = mesh::oneshot(); diff --git a/vm/devices/vmbus/vmbus_server/src/lib.rs b/vm/devices/vmbus/vmbus_server/src/lib.rs index a0c5e95709..131c6f4331 100644 --- a/vm/devices/vmbus/vmbus_server/src/lib.rs +++ b/vm/devices/vmbus/vmbus_server/src/lib.rs @@ -52,7 +52,6 @@ pub use proxyintegration::ProxyServerInfo; use ring::PAGE_SIZE; use std::collections::HashMap; use std::future; -use std::future::Future; use std::pin::Pin; use std::sync::Arc; use std::task::ready; diff --git a/vm/vmcore/src/device_state.rs b/vm/vmcore/src/device_state.rs index 7056bb5cc9..b13cb645f7 100644 --- a/vm/vmcore/src/device_state.rs +++ b/vm/vmcore/src/device_state.rs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -use std::future::Future; /// Trait for transitioning device state. pub trait ChangeDeviceState { diff --git a/vm/vmcore/src/notify.rs b/vm/vmcore/src/notify.rs index 399ff26bc6..2f49e04e5e 100644 --- a/vm/vmcore/src/notify.rs +++ b/vm/vmcore/src/notify.rs @@ -13,7 +13,6 @@ use pal_async::wait::PolledWait; use pal_event::Event; use parking_lot::Mutex; use std::future::poll_fn; -use std::future::Future; use std::sync::Arc; use std::task::Context; use std::task::Poll; diff --git a/vm/vmcore/src/slim_event.rs b/vm/vmcore/src/slim_event.rs index 4df731c231..340a717eca 100644 --- a/vm/vmcore/src/slim_event.rs +++ b/vm/vmcore/src/slim_event.rs @@ -6,7 +6,6 @@ use futures::Stream; use parking_lot::Mutex; use std::future::poll_fn; -use std::future::Future; use std::pin::Pin; use std::task::Context; use std::task::Poll; diff --git a/vm/vmcore/src/vm_task.rs b/vm/vmcore/src/vm_task.rs index 7ed73c86ae..62279da711 100644 --- a/vm/vmcore/src/vm_task.rs +++ b/vm/vmcore/src/vm_task.rs @@ -78,7 +78,7 @@ pub trait TargetedDriver: 'static + Send + Sync + Inspect { true } /// Waits for this driver's target VP to be ready for tasks and IO. - fn wait_target_vp_ready(&self) -> impl std::future::Future + Send { + fn wait_target_vp_ready(&self) -> impl Future + Send { std::future::ready(()) } } @@ -88,7 +88,7 @@ trait DynTargetedDriver: 'static + Send + Sync + Inspect { fn driver(&self) -> &dyn Driver; fn retarget_vp(&self, target_vp: u32); fn is_ready(&self) -> bool; - fn wait_ready(&self) -> Pin + Send>>; + fn wait_ready(&self) -> Pin + Send>>; } impl DynTargetedDriver for T { @@ -108,7 +108,7 @@ impl DynTargetedDriver for T { self.is_target_vp_ready() } - fn wait_ready(&self) -> Pin + Send>> { + fn wait_ready(&self) -> Pin + Send>> { Box::pin(self.wait_target_vp_ready()) } } diff --git a/vm/x86/x86emu/src/cpu.rs b/vm/x86/x86emu/src/cpu.rs index bd3848115f..53df82a8be 100644 --- a/vm/x86/x86emu/src/cpu.rs +++ b/vm/x86/x86emu/src/cpu.rs @@ -5,7 +5,6 @@ use crate::registers::RegisterIndex; use crate::registers::Segment; -use std::future::Future; use x86defs::RFlags; use x86defs::SegmentRegister; diff --git a/vmm_core/src/partition_unit/vp_set.rs b/vmm_core/src/partition_unit/vp_set.rs index 6daab0e105..8731bf5cdf 100644 --- a/vmm_core/src/partition_unit/vp_set.rs +++ b/vmm_core/src/partition_unit/vp_set.rs @@ -24,7 +24,6 @@ use mesh::rpc::RpcError; use mesh::rpc::RpcSend; use parking_lot::Mutex; use slab::Slab; -use std::future::Future; use std::pin::pin; use std::pin::Pin; use std::sync::Arc; diff --git a/vmm_core/src/vmotherboard_adapter.rs b/vmm_core/src/vmotherboard_adapter.rs index 1c14faacca..2a2085cf10 100644 --- a/vmm_core/src/vmotherboard_adapter.rs +++ b/vmm_core/src/vmotherboard_adapter.rs @@ -63,7 +63,7 @@ impl CpuIo for ChipsetPlusSynic { vp: VpIndex, address: u64, data: &mut [u8], - ) -> impl std::future::Future { + ) -> impl Future { self.chipset.mmio_read(vp.index(), address, data) } @@ -72,7 +72,7 @@ impl CpuIo for ChipsetPlusSynic { vp: VpIndex, address: u64, data: &[u8], - ) -> impl std::future::Future { + ) -> impl Future { self.chipset.mmio_write(vp.index(), address, data) } @@ -81,7 +81,7 @@ impl CpuIo for ChipsetPlusSynic { vp: VpIndex, port: u16, data: &mut [u8], - ) -> impl std::future::Future { + ) -> impl Future { self.chipset.io_read(vp.index(), port, data) } @@ -90,7 +90,7 @@ impl CpuIo for ChipsetPlusSynic { vp: VpIndex, port: u16, data: &[u8], - ) -> impl std::future::Future { + ) -> impl Future { self.chipset.io_write(vp.index(), port, data) } } diff --git a/vmm_core/state_unit/src/lib.rs b/vmm_core/state_unit/src/lib.rs index 7752cac3b2..288730ae9a 100644 --- a/vmm_core/state_unit/src/lib.rs +++ b/vmm_core/state_unit/src/lib.rs @@ -50,7 +50,6 @@ use std::collections::BTreeMap; use std::collections::HashMap; use std::fmt::Debug; use std::fmt::Display; -use std::future::Future; use std::pin::pin; use std::sync::atomic::AtomicU32; use std::sync::atomic::Ordering; diff --git a/vmm_core/virt/src/generic.rs b/vmm_core/virt/src/generic.rs index 3680ce08a7..d04e03c81f 100644 --- a/vmm_core/virt/src/generic.rs +++ b/vmm_core/virt/src/generic.rs @@ -25,7 +25,6 @@ use std::cell::Cell; use std::convert::Infallible; use std::fmt::Debug; use std::future::poll_fn; -use std::future::Future; use std::pin::pin; use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; diff --git a/vmm_core/virt/src/io.rs b/vmm_core/virt/src/io.rs index 4c065258b3..7aca751bc1 100644 --- a/vmm_core/virt/src/io.rs +++ b/vmm_core/virt/src/io.rs @@ -2,7 +2,6 @@ // Licensed under the MIT License. use hvdef::Vtl; -use std::future::Future; use vm_topology::processor::VpIndex; /// This trait provides the operations between the VP dispatch loop and the diff --git a/workers/debug_worker/src/lib.rs b/workers/debug_worker/src/lib.rs index c797292aea..93eaf55591 100644 --- a/workers/debug_worker/src/lib.rs +++ b/workers/debug_worker/src/lib.rs @@ -31,7 +31,6 @@ use pal_async::socket::Listener; use pal_async::socket::PolledSocket; use socket2::Socket; use std::fmt::Display; -use std::future::Future; use std::io::Write; use std::net::TcpListener; use std::pin::Pin; diff --git a/workers/vnc_worker/src/lib.rs b/workers/vnc_worker/src/lib.rs index f3a32c0f03..d29652cb03 100644 --- a/workers/vnc_worker/src/lib.rs +++ b/workers/vnc_worker/src/lib.rs @@ -18,7 +18,6 @@ use pal_async::local::LocalDriver; use pal_async::socket::Listener; use pal_async::socket::PolledSocket; use pal_async::timer::PolledTimer; -use std::future::Future; use std::net::TcpListener; use std::pin::Pin; use std::time::Duration; diff --git a/xsync/Cargo.toml b/xsync/Cargo.toml index 98e033d1fe..14b5b0f18f 100644 --- a/xsync/Cargo.toml +++ b/xsync/Cargo.toml @@ -8,7 +8,7 @@ resolver = "2" [workspace.package] rust-version = "1.85" -edition = "2021" +edition = "2024" [workspace.dependencies] anyhow = "1.0"