Skip to content

[DO NOT MERGE] Just try the 2024 edition #988

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ exclude = [

[workspace.package]
rust-version = "1.85"
edition = "2021"
edition = "2024"

[workspace.dependencies]
xtask_fuzz = { path = "xtask/xtask_fuzz" }
Expand Down
2 changes: 1 addition & 1 deletion Guide/mdbook-openvmm-shim/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions flowey/flowey_cli/src/pipeline_resolver/ado_yaml.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 7 additions & 5 deletions flowey/flowey_cli/src/pipeline_resolver/github_yaml/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion openhcl/ohcldiag-dev/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ fn create_or_stderr(path: &Option<PathBuf>) -> std::io::Result<fs_err::File> {

async fn capture_packets(
client: DiagClient,
streams: Vec<impl std::future::Future<Output = Result<u64, std::io::Error>>>,
streams: Vec<impl Future<Output = Result<u64, std::io::Error>>>,
capture_duration: Duration,
) {
let mut capture_streams = FuturesUnordered::from_iter(streams);
Expand Down
4 changes: 2 additions & 2 deletions openhcl/underhill_core/src/emuplat/netvsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ impl HclNetworkVFManager {
) -> anyhow::Result<Box<dyn netvsp::VirtualFunction>>
where
F: Fn(bool) -> R + Sync + Send + 'static,
R: std::future::Future<Output = bool> + Send,
R: Future<Output = bool> + Send,
{
let (tx_update, rx_update) = mesh::channel();
let guest_state = self
Expand Down Expand Up @@ -1095,7 +1095,7 @@ impl<F> HclNetworkVFManagerInstance<F> {
impl<F, R> netvsp::VirtualFunction for HclNetworkVFManagerInstance<F>
where
F: Fn(bool) -> R + Sync + Send + 'static,
R: std::future::Future<Output = bool> + Send,
R: Future<Output = bool> + Send,
{
async fn id(&self) -> Option<u32> {
self.guest_state.vtl0_vfid().await
Expand Down
10 changes: 4 additions & 6 deletions openhcl/underhill_core/src/loader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions openhcl/virt_mshv_vtl/src/processor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion openvmm/membacking/src/mapping_manager/object_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

use mesh::MeshPayload;
use parking_lot::Mutex;
use std::future::Future;
use std::sync::Arc;
use std::sync::Weak;

Expand Down
1 change: 0 additions & 1 deletion openvmm/openvmm_entry/src/ttrpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion petri/src/vm/openvmm/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions support/clap_dyn_complete/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Output = Self::CustomCompleter>;
fn build(&self, ctx: &RootCtx<'_>) -> impl Future<Output = Self::CustomCompleter>;
}

/// A custom completer for a particular argument.
Expand All @@ -297,7 +297,7 @@ pub trait CustomCompleter: Send + Sync {
ctx: &RootCtx<'_>,
subcommand_path: &[&str],
arg_id: &str,
) -> impl Send + std::future::Future<Output = Vec<String>>;
) -> impl Send + Future<Output = Vec<String>>;
}

#[async_trait::async_trait]
Expand Down
7 changes: 3 additions & 4 deletions support/fast_select/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion support/inspect/src/initiate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 5 additions & 6 deletions support/mesh/mesh_channel/src/bidir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions support/mesh/mesh_channel/src/cancel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 2 additions & 7 deletions support/mesh/mesh_channel/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -160,11 +159,7 @@ impl<T: 'static + Clone + MeshField + Sync + Send> CellUpdater<T> {
}
}
}
if wait {
Poll::Pending
} else {
Poll::Ready(())
}
if wait { Poll::Pending } else { Poll::Ready(()) }
})
}
}
Expand Down Expand Up @@ -329,9 +324,9 @@ impl<T: 'static + MeshField + Send + Sync + Clone> From<EncodedCell<T>> 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;

Expand Down
17 changes: 7 additions & 10 deletions support/mesh/mesh_channel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -631,7 +628,7 @@ mod mpsc {

impl<T> Debug for MpscSender<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Debug::fmt(&self.0 .0, f)
Debug::fmt(&self.0.0, f)
}
}

Expand Down
Loading
Loading