diff --git a/src/manifest.rs b/src/manifest.rs index c4bbae5..0ab2fa7 100644 --- a/src/manifest.rs +++ b/src/manifest.rs @@ -7,6 +7,8 @@ use std::path::PathBuf; #[derive(Serialize, Debug)] pub struct Manifest { + #[serde(rename = "cargo-features")] + pub cargo_features: Vec, pub package: Package, #[serde(skip_serializing_if = "Map::is_empty")] pub features: Map>, @@ -44,6 +46,8 @@ pub enum Edition { E2018, #[serde(rename = "2021")] E2021, + #[serde(rename = "2024")] + E2024, } #[derive(Serialize, Debug)] diff --git a/src/run.rs b/src/run.rs index f26d6a5..3e95649 100644 --- a/src/run.rs +++ b/src/run.rs @@ -5,7 +5,7 @@ use crate::env::Update; use crate::error::{Error, Result}; use crate::expand::{expand_globs, ExpandedTest}; use crate::flock::Lock; -use crate::manifest::{Bin, Build, Config, Manifest, Name, Package, Workspace}; +use crate::manifest::{Bin, Build, Config, Edition, Manifest, Name, Package, Workspace}; use crate::message::{self, Fail, Warn}; use crate::normalize::{self, Context, Variations}; use crate::{features, rustflags, Expected, Runner, Test}; @@ -222,6 +222,12 @@ impl Runner { .ok_or(Error::NoWorkspaceManifest)?, }; + let cargo_features = if let Edition::E2024 = edition { + vec!["edition2024".to_owned()] + } else { + vec![] + }; + let mut dependencies = Map::new(); dependencies.extend(source_manifest.dependencies); dependencies.extend(source_manifest.dev_dependencies); @@ -286,6 +292,7 @@ impl Runner { } let mut manifest = Manifest { + cargo_features, package: Package { name: project_name.to_owned(), version: "0.0.0".to_owned(),