From 25a84dae22aba15ef8d43a419aad2720459175b0 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 15 Nov 2024 12:37:55 -0600 Subject: [PATCH] feat: Stabilize Edition 2024 --- src/cargo/core/features.rs | 10 +-- src/cargo/util/toml/mod.rs | 4 +- src/doc/src/reference/resolver.md | 2 +- src/doc/src/reference/unstable.md | 34 ++------ tests/testsuite/bad_config.rs | 61 +++----------- .../cargo_init/auto_git/out/Cargo.toml | 2 +- .../out/Cargo.toml | 2 +- .../out/Cargo.toml | 2 +- .../out/Cargo.toml | 2 +- .../out/Cargo.toml | 2 +- .../out/Cargo.toml | 2 +- .../out/Cargo.toml | 2 +- .../out/Cargo.toml | 2 +- .../out/Cargo.toml | 2 +- .../out/Cargo.toml | 2 +- .../explicit_bin_with_git/out/Cargo.toml | 2 +- .../cargo_init/formats_source/out/Cargo.toml | 2 +- .../fossil_autodetect/out/Cargo.toml | 2 +- .../cargo_init/git_autodetect/out/Cargo.toml | 2 +- .../out/Cargo.toml | 2 +- .../inferred_bin_with_git/out/Cargo.toml | 2 +- .../inferred_lib_with_git/out/Cargo.toml | 2 +- .../lib_already_exists_nosrc/out/Cargo.toml | 2 +- .../lib_already_exists_src/out/Cargo.toml | 2 +- .../mercurial_autodetect/out/Cargo.toml | 2 +- .../pijul_autodetect/out/Cargo.toml | 2 +- .../cargo_init/simple_git/out/Cargo.toml | 2 +- .../cargo_init/simple_hg/out/Cargo.toml | 2 +- .../simple_hg_ignore_exists/out/Cargo.toml | 2 +- .../with_argument/out/foo/Cargo.toml | 2 +- .../out/crates/foo/Cargo.toml | 2 +- .../out/bar/Cargo.toml | 2 +- .../out/crates/foo/Cargo.toml | 2 +- .../out/crates/foo/Cargo.toml | 2 +- .../out/crates/foo/Cargo.toml | 2 +- .../out/crates/foo/Cargo.toml | 2 +- .../out/crates/foo/Cargo.toml | 2 +- .../out/crates/foo/Cargo.toml | 2 +- .../out/bar/Cargo.toml | 2 +- .../out/out-of-workspace/Cargo.toml | 2 +- .../out/crates/foo/Cargo.toml | 2 +- .../out/crates/foo/Cargo.toml | 2 +- .../out/bar/Cargo.toml | 2 +- tests/testsuite/check.rs | 5 +- tests/testsuite/fix.rs | 16 ---- .../testsuite/inheritable_workspace_fields.rs | 10 +-- tests/testsuite/lockfile_path.rs | 2 +- tests/testsuite/rust_version.rs | 14 +--- tests/testsuite/script.rs | 80 +++++++++---------- 49 files changed, 109 insertions(+), 205 deletions(-) diff --git a/src/cargo/core/features.rs b/src/cargo/core/features.rs index 8bce51535f84..54106492c084 100644 --- a/src/cargo/core/features.rs +++ b/src/cargo/core/features.rs @@ -200,9 +200,9 @@ impl Edition { /// The latest edition that is unstable. /// /// This is `None` if there is no next unstable edition. - pub const LATEST_UNSTABLE: Option = Some(Edition::Edition2024); + pub const LATEST_UNSTABLE: Option = None; /// The latest stable edition. - pub const LATEST_STABLE: Edition = Edition::Edition2021; + pub const LATEST_STABLE: Edition = Edition::Edition2024; pub const ALL: &'static [Edition] = &[ Self::Edition2015, Self::Edition2018, @@ -223,7 +223,7 @@ impl Edition { Edition2015 => None, Edition2018 => Some(semver::Version::new(1, 31, 0)), Edition2021 => Some(semver::Version::new(1, 56, 0)), - Edition2024 => None, + Edition2024 => Some(semver::Version::new(1, 85, 0)), } } @@ -234,7 +234,7 @@ impl Edition { Edition2015 => true, Edition2018 => true, Edition2021 => true, - Edition2024 => false, + Edition2024 => true, } } @@ -507,7 +507,7 @@ features! { (stable, workspace_inheritance, "1.64", "reference/unstable.html#workspace-inheritance"), /// Support for 2024 edition. - (unstable, edition2024, "", "reference/unstable.html#edition-2024"), + (stable, edition2024, "1.85", "reference/unstable.html#edition-2024"), /// Allow setting trim-paths in a profile to control the sanitisation of file paths in build outputs. (unstable, trim_paths, "", "reference/unstable.html#profile-trim-paths-option"), diff --git a/src/cargo/util/toml/mod.rs b/src/cargo/util/toml/mod.rs index c0f6df61d905..bd1fcf142c9e 100644 --- a/src/cargo/util/toml/mod.rs +++ b/src/cargo/util/toml/mod.rs @@ -1217,9 +1217,7 @@ pub fn to_real_manifest( // features.require(Feature::edition20xx())?; // } // ``` - if edition == Edition::Edition2024 { - features.require(Feature::edition2024())?; - } else if !edition.is_stable() { + if !edition.is_stable() { // Guard in case someone forgets to add .require() return Err(util::errors::internal(format!( "edition {} should be gated", diff --git a/src/doc/src/reference/resolver.md b/src/doc/src/reference/resolver.md index bc41517b21f4..f080509fc58c 100644 --- a/src/doc/src/reference/resolver.md +++ b/src/doc/src/reference/resolver.md @@ -507,7 +507,7 @@ resolver = "2" - `"2"` ([`edition = "2021"`](manifest.md#the-edition-field) default): Introduces changes in [feature unification](#features). See the [features chapter][features-2] for more details. -- `"3"` (requires Rust 1.84+): Change the default for [`resolver.incompatible-rust-versions`] from `allow` to `fallback` +- `"3"` ([`edition = "2024"`](manifest.md#the-edition-field) default, requires Rust 1.84+): Change the default for [`resolver.incompatible-rust-versions`] from `allow` to `fallback` The resolver is a global option that affects the entire workspace. The `resolver` version in dependencies is ignored, only the value in the top-level diff --git a/src/doc/src/reference/unstable.md b/src/doc/src/reference/unstable.md index c59600a5d5e8..7dcf79dc7b10 100644 --- a/src/doc/src/reference/unstable.md +++ b/src/doc/src/reference/unstable.md @@ -100,7 +100,6 @@ Each new feature described below should explain how to use it. * [codegen-backend](#codegen-backend) --- Select the codegen backend used by rustc. * [per-package-target](#per-package-target) --- Sets the `--target` to use for each individual package. * [artifact dependencies](#artifact-dependencies) --- Allow build artifacts to be included into other build artifacts and build them for different targets. - * [Edition 2024](#edition-2024) — Adds support for the 2024 Edition. * [Profile `trim-paths` option](#profile-trim-paths-option) --- Control the sanitization of file paths in build outputs. * [`[lints.cargo]`](#lintscargo) --- Allows configuring lints for Cargo. * [path bases](#path-bases) --- Named base directories for path dependencies. @@ -1363,32 +1362,6 @@ Differences between `cargo run --manifest-path ` and `cargo ` ### Documentation Updates -## Edition 2024 -* Tracking Issue: (none created yet) -* RFC: [rust-lang/rfcs#3501](https://github.com/rust-lang/rfcs/pull/3501) - -Support for the 2024 [edition] can be enabled by adding the `edition2024` -unstable feature to the top of `Cargo.toml`: - -```toml -cargo-features = ["edition2024"] - -[package] -name = "my-package" -version = "0.1.0" -edition = "2024" -``` - -If you want to transition an existing project from a previous edition, then -`cargo fix --edition` can be used on the nightly channel. After running `cargo -fix`, you can switch the edition to 2024 as illustrated above. - -This feature is very unstable, and is only intended for early testing and -experimentation. Future nightly releases may introduce changes for the 2024 -edition that may break your build. - -[edition]: ../../edition-guide/index.html - ## Profile `trim-paths` option * Tracking Issue: [rust-lang/cargo#12137](https://github.com/rust-lang/cargo/issues/12137) @@ -2013,3 +1986,10 @@ default behavior. See the [build script documentation](build-scripts.md#rustc-check-cfg) for information about specifying custom cfgs. + +## Edition 2024 + +The 2024 edition has been stabilized in the 1.85 release. +See the [`edition` field](manifest.md#the-edition-field) for more information on setting the edition. +See [`cargo fix --edition`](../commands/cargo-fix.md) and [The Edition Guide](../../edition-guide/index.html) for more information on migrating existing projects. + diff --git a/tests/testsuite/bad_config.rs b/tests/testsuite/bad_config.rs index ace08f4392f5..bf1b0da2a34c 100644 --- a/tests/testsuite/bad_config.rs +++ b/tests/testsuite/bad_config.rs @@ -831,14 +831,12 @@ fn dev_dependencies2() { "#]]).run(); } -#[cargo_test(nightly, reason = "edition2024 is not stable")] +#[cargo_test] fn dev_dependencies2_2024() { let p = project() .file( "Cargo.toml", r#" - cargo-features = ["edition2024"] - [package] name = "foo" version = "0.1.0" @@ -861,7 +859,6 @@ fn dev_dependencies2_2024() { .file("a/src/lib.rs", "") .build(); p.cargo("check") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_status(101) .with_stderr_data(str![[r#" [ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml` @@ -949,14 +946,12 @@ fn build_dependencies2() { "#]]).run(); } -#[cargo_test(nightly, reason = "edition2024 is not stable")] +#[cargo_test] fn build_dependencies2_2024() { let p = project() .file( "Cargo.toml", r#" - cargo-features = ["edition2024"] - [package] name = "foo" version = "0.1.0" @@ -979,7 +974,6 @@ fn build_dependencies2_2024() { .file("a/src/lib.rs", "") .build(); p.cargo("check") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_status(101) .with_stderr_data(str![[r#" [ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml` @@ -1060,14 +1054,12 @@ fn lib_crate_type2() { .run(); } -#[cargo_test(nightly, reason = "edition2024 is not stable")] +#[cargo_test] fn lib_crate_type2_2024() { let p = project() .file( "Cargo.toml", r#" - cargo-features = ["edition2024"] - [package] name = "foo" version = "0.5.0" @@ -1082,7 +1074,6 @@ fn lib_crate_type2_2024() { .file("src/lib.rs", "pub fn foo() {}") .build(); p.cargo("check") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_status(101) .with_stderr_data(str![[r#" [ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml` @@ -1154,14 +1145,12 @@ fn bin_crate_type2() { .run(); } -#[cargo_test(nightly, reason = "edition2024 is not stable")] +#[cargo_test] fn bin_crate_type2_2024() { let p = project() .file( "Cargo.toml", r#" - cargo-features = ["edition2024"] - [package] name = "foo" version = "0.5.0" @@ -1177,7 +1166,6 @@ fn bin_crate_type2_2024() { .file("src/main.rs", "fn main() {}") .build(); p.cargo("check") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_status(101) .with_stderr_data(str![[r#" [ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml` @@ -1268,14 +1256,12 @@ fn examples_crate_type2() { .run(); } -#[cargo_test(nightly, reason = "edition2024 is not stable")] +#[cargo_test] fn examples_crate_type2_2024() { let p = project() .file( "Cargo.toml", r#" - cargo-features = ["edition2024"] - [package] name = "foo" version = "0.5.0" @@ -1307,7 +1293,6 @@ fn examples_crate_type2_2024() { ) .build(); p.cargo("check") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_status(101) .with_stderr_data(str![[r#" [ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml` @@ -1411,7 +1396,7 @@ fn cargo_platform_build_dependencies2() { .run(); } -#[cargo_test(nightly, reason = "edition2024 is not stable")] +#[cargo_test] fn cargo_platform_build_dependencies2_2024() { let host = rustc_host(); let p = project() @@ -1419,8 +1404,6 @@ fn cargo_platform_build_dependencies2_2024() { "Cargo.toml", &format!( r#" - cargo-features = ["edition2024"] - [package] name = "foo" version = "0.5.0" @@ -1444,7 +1427,6 @@ fn cargo_platform_build_dependencies2_2024() { .build(); p.cargo("check") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_status(101) .with_stderr_data(str![[r#" [ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml` @@ -1543,7 +1525,7 @@ fn cargo_platform_dev_dependencies2() { .run(); } -#[cargo_test(nightly, reason = "edition2024 is not stable")] +#[cargo_test] fn cargo_platform_dev_dependencies2_2024() { let host = rustc_host(); let p = project() @@ -1551,8 +1533,6 @@ fn cargo_platform_dev_dependencies2_2024() { "Cargo.toml", &format!( r#" - cargo-features = ["edition2024"] - [package] name = "foo" version = "0.5.0" @@ -1575,7 +1555,6 @@ fn cargo_platform_dev_dependencies2_2024() { .build(); p.cargo("check") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_status(101) .with_stderr_data(str![[r#" [ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml` @@ -1675,14 +1654,12 @@ fn default_features2() { "#]]).run(); } -#[cargo_test(nightly, reason = "edition2024 is not stable")] +#[cargo_test] fn default_features2_2024() { let p = project() .file( "Cargo.toml", r#" - cargo-features = ["edition2024"] - [package] name = "foo" version = "0.1.0" @@ -1712,7 +1689,6 @@ fn default_features2_2024() { .build(); p.cargo("check") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_status(101) .with_stderr_data(str![[r#" [ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml` @@ -1852,7 +1828,7 @@ fn workspace_default_features2() { .run(); } -#[cargo_test(nightly, reason = "edition2024 is not stable")] +#[cargo_test] fn workspace_default_features2_2024() { let p = project() .file( @@ -1869,8 +1845,6 @@ fn workspace_default_features2_2024() { .file( "workspace_only/Cargo.toml", r#" - cargo-features = ["edition2024"] - [package] name = "workspace_only" version = "0.1.0" @@ -1885,8 +1859,6 @@ fn workspace_default_features2_2024() { .file( "dep_workspace_only/Cargo.toml", r#" - cargo-features = ["edition2024"] - [package] name = "dep_workspace_only" version = "0.1.0" @@ -1898,8 +1870,6 @@ fn workspace_default_features2_2024() { .file( "package_only/Cargo.toml", r#" - cargo-features = ["edition2024"] - [package] name = "package_only" version = "0.1.0" @@ -1914,8 +1884,6 @@ fn workspace_default_features2_2024() { .file( "dep_package_only/Cargo.toml", r#" - cargo-features = ["edition2024"] - [package] name = "dep_package_only" version = "0.1.0" @@ -1927,7 +1895,6 @@ fn workspace_default_features2_2024() { .build(); p.cargo("check") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_status(101) .with_stderr_data(str![[r#" [ERROR] failed to load manifest for workspace member `[ROOT]/foo/workspace_only` @@ -1972,14 +1939,12 @@ fn lib_proc_macro2() { .run(); } -#[cargo_test(nightly, reason = "edition2024 is not stable")] +#[cargo_test] fn lib_proc_macro2_2024() { let foo = project() .file( "Cargo.toml", r#" - cargo-features = ["edition2024"] - [package] name = "foo" version = "0.1.0" @@ -1992,7 +1957,6 @@ fn lib_proc_macro2_2024() { .build(); foo.cargo("check") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_status(101) .with_stderr_data(str![[r#" [ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml` @@ -2063,14 +2027,12 @@ fn bin_proc_macro2() { .run(); } -#[cargo_test(nightly, reason = "edition2024 is not stable")] +#[cargo_test] fn bin_proc_macro2_2024() { let foo = project() .file( "Cargo.toml", r#" - cargo-features = ["edition2024"] - [package] name = "foo" version = "0.5.0" @@ -2087,7 +2049,6 @@ fn bin_proc_macro2_2024() { .build(); foo.cargo("check") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_status(101) .with_stderr_data(str![[r#" [ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml` diff --git a/tests/testsuite/cargo_init/auto_git/out/Cargo.toml b/tests/testsuite/cargo_init/auto_git/out/Cargo.toml index dfab9e3fdbe9..797f753b4305 100644 --- a/tests/testsuite/cargo_init/auto_git/out/Cargo.toml +++ b/tests/testsuite/cargo_init/auto_git/out/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/bin_already_exists_explicit/out/Cargo.toml b/tests/testsuite/cargo_init/bin_already_exists_explicit/out/Cargo.toml index dfab9e3fdbe9..797f753b4305 100644 --- a/tests/testsuite/cargo_init/bin_already_exists_explicit/out/Cargo.toml +++ b/tests/testsuite/cargo_init/bin_already_exists_explicit/out/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/out/Cargo.toml b/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/out/Cargo.toml index 2a5dcadee6c0..d0ebc5d6b302 100644 --- a/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/out/Cargo.toml +++ b/tests/testsuite/cargo_init/bin_already_exists_explicit_nosrc/out/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/bin_already_exists_implicit/out/Cargo.toml b/tests/testsuite/cargo_init/bin_already_exists_implicit/out/Cargo.toml index dfab9e3fdbe9..797f753b4305 100644 --- a/tests/testsuite/cargo_init/bin_already_exists_implicit/out/Cargo.toml +++ b/tests/testsuite/cargo_init/bin_already_exists_implicit/out/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/out/Cargo.toml b/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/out/Cargo.toml index a16d0374d2e6..fc26d6b815db 100644 --- a/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/out/Cargo.toml +++ b/tests/testsuite/cargo_init/bin_already_exists_implicit_namenosrc/out/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/out/Cargo.toml b/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/out/Cargo.toml index c318f457a3bc..18e8d4eef010 100644 --- a/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/out/Cargo.toml +++ b/tests/testsuite/cargo_init/bin_already_exists_implicit_namesrc/out/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/out/Cargo.toml b/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/out/Cargo.toml index 2a5dcadee6c0..d0ebc5d6b302 100644 --- a/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/out/Cargo.toml +++ b/tests/testsuite/cargo_init/bin_already_exists_implicit_nosrc/out/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/out/Cargo.toml b/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/out/Cargo.toml index 7b042d4bb130..5add2f88f262 100644 --- a/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/out/Cargo.toml +++ b/tests/testsuite/cargo_init/creates_binary_when_both_binlib_present/out/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/out/Cargo.toml b/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/out/Cargo.toml index a16d0374d2e6..fc26d6b815db 100644 --- a/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/out/Cargo.toml +++ b/tests/testsuite/cargo_init/creates_binary_when_instructed_and_has_lib_file/out/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/out/Cargo.toml b/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/out/Cargo.toml index 6fa93832300e..51e0c792066b 100644 --- a/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/out/Cargo.toml +++ b/tests/testsuite/cargo_init/creates_library_when_instructed_and_has_bin_file/out/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/explicit_bin_with_git/out/Cargo.toml b/tests/testsuite/cargo_init/explicit_bin_with_git/out/Cargo.toml index dfab9e3fdbe9..797f753b4305 100644 --- a/tests/testsuite/cargo_init/explicit_bin_with_git/out/Cargo.toml +++ b/tests/testsuite/cargo_init/explicit_bin_with_git/out/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/formats_source/out/Cargo.toml b/tests/testsuite/cargo_init/formats_source/out/Cargo.toml index dfab9e3fdbe9..797f753b4305 100644 --- a/tests/testsuite/cargo_init/formats_source/out/Cargo.toml +++ b/tests/testsuite/cargo_init/formats_source/out/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/fossil_autodetect/out/Cargo.toml b/tests/testsuite/cargo_init/fossil_autodetect/out/Cargo.toml index dfab9e3fdbe9..797f753b4305 100644 --- a/tests/testsuite/cargo_init/fossil_autodetect/out/Cargo.toml +++ b/tests/testsuite/cargo_init/fossil_autodetect/out/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/git_autodetect/out/Cargo.toml b/tests/testsuite/cargo_init/git_autodetect/out/Cargo.toml index 878c67291470..051260800079 100644 --- a/tests/testsuite/cargo_init/git_autodetect/out/Cargo.toml +++ b/tests/testsuite/cargo_init/git_autodetect/out/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "foo" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/ignores_failure_to_format_source/out/Cargo.toml b/tests/testsuite/cargo_init/ignores_failure_to_format_source/out/Cargo.toml index dfab9e3fdbe9..797f753b4305 100644 --- a/tests/testsuite/cargo_init/ignores_failure_to_format_source/out/Cargo.toml +++ b/tests/testsuite/cargo_init/ignores_failure_to_format_source/out/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/inferred_bin_with_git/out/Cargo.toml b/tests/testsuite/cargo_init/inferred_bin_with_git/out/Cargo.toml index 2a5dcadee6c0..d0ebc5d6b302 100644 --- a/tests/testsuite/cargo_init/inferred_bin_with_git/out/Cargo.toml +++ b/tests/testsuite/cargo_init/inferred_bin_with_git/out/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/inferred_lib_with_git/out/Cargo.toml b/tests/testsuite/cargo_init/inferred_lib_with_git/out/Cargo.toml index 290552e56b57..2feac72d2b90 100644 --- a/tests/testsuite/cargo_init/inferred_lib_with_git/out/Cargo.toml +++ b/tests/testsuite/cargo_init/inferred_lib_with_git/out/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/lib_already_exists_nosrc/out/Cargo.toml b/tests/testsuite/cargo_init/lib_already_exists_nosrc/out/Cargo.toml index 290552e56b57..2feac72d2b90 100644 --- a/tests/testsuite/cargo_init/lib_already_exists_nosrc/out/Cargo.toml +++ b/tests/testsuite/cargo_init/lib_already_exists_nosrc/out/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/lib_already_exists_src/out/Cargo.toml b/tests/testsuite/cargo_init/lib_already_exists_src/out/Cargo.toml index dfab9e3fdbe9..797f753b4305 100644 --- a/tests/testsuite/cargo_init/lib_already_exists_src/out/Cargo.toml +++ b/tests/testsuite/cargo_init/lib_already_exists_src/out/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/mercurial_autodetect/out/Cargo.toml b/tests/testsuite/cargo_init/mercurial_autodetect/out/Cargo.toml index dfab9e3fdbe9..797f753b4305 100644 --- a/tests/testsuite/cargo_init/mercurial_autodetect/out/Cargo.toml +++ b/tests/testsuite/cargo_init/mercurial_autodetect/out/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/pijul_autodetect/out/Cargo.toml b/tests/testsuite/cargo_init/pijul_autodetect/out/Cargo.toml index dfab9e3fdbe9..797f753b4305 100644 --- a/tests/testsuite/cargo_init/pijul_autodetect/out/Cargo.toml +++ b/tests/testsuite/cargo_init/pijul_autodetect/out/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/simple_git/out/Cargo.toml b/tests/testsuite/cargo_init/simple_git/out/Cargo.toml index dfab9e3fdbe9..797f753b4305 100644 --- a/tests/testsuite/cargo_init/simple_git/out/Cargo.toml +++ b/tests/testsuite/cargo_init/simple_git/out/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/simple_hg/out/Cargo.toml b/tests/testsuite/cargo_init/simple_hg/out/Cargo.toml index dfab9e3fdbe9..797f753b4305 100644 --- a/tests/testsuite/cargo_init/simple_hg/out/Cargo.toml +++ b/tests/testsuite/cargo_init/simple_hg/out/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/simple_hg_ignore_exists/out/Cargo.toml b/tests/testsuite/cargo_init/simple_hg_ignore_exists/out/Cargo.toml index dfab9e3fdbe9..797f753b4305 100644 --- a/tests/testsuite/cargo_init/simple_hg_ignore_exists/out/Cargo.toml +++ b/tests/testsuite/cargo_init/simple_hg_ignore_exists/out/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "case" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/with_argument/out/foo/Cargo.toml b/tests/testsuite/cargo_init/with_argument/out/foo/Cargo.toml index 878c67291470..051260800079 100644 --- a/tests/testsuite/cargo_init/with_argument/out/foo/Cargo.toml +++ b/tests/testsuite/cargo_init/with_argument/out/foo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "foo" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_init/workspace_add_member/out/crates/foo/Cargo.toml b/tests/testsuite/cargo_init/workspace_add_member/out/crates/foo/Cargo.toml index 878c67291470..051260800079 100644 --- a/tests/testsuite/cargo_init/workspace_add_member/out/crates/foo/Cargo.toml +++ b/tests/testsuite/cargo_init/workspace_add_member/out/crates/foo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "foo" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_new/add_members_to_non_workspace/out/bar/Cargo.toml b/tests/testsuite/cargo_new/add_members_to_non_workspace/out/bar/Cargo.toml index fe23452f35a9..845311fc8065 100644 --- a/tests/testsuite/cargo_new/add_members_to_non_workspace/out/bar/Cargo.toml +++ b/tests/testsuite/cargo_new/add_members_to_non_workspace/out/bar/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bar" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_new/add_members_to_workspace_format_previous_items/out/crates/foo/Cargo.toml b/tests/testsuite/cargo_new/add_members_to_workspace_format_previous_items/out/crates/foo/Cargo.toml index d4c524921147..956aa0f18002 100644 --- a/tests/testsuite/cargo_new/add_members_to_workspace_format_previous_items/out/crates/foo/Cargo.toml +++ b/tests/testsuite/cargo_new/add_members_to_workspace_format_previous_items/out/crates/foo/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "foo" version = "0.1.0" -edition = "2021" +edition = "2024" authors.workspace = true [dependencies] diff --git a/tests/testsuite/cargo_new/add_members_to_workspace_format_sorted/out/crates/foo/Cargo.toml b/tests/testsuite/cargo_new/add_members_to_workspace_format_sorted/out/crates/foo/Cargo.toml index 878c67291470..051260800079 100644 --- a/tests/testsuite/cargo_new/add_members_to_workspace_format_sorted/out/crates/foo/Cargo.toml +++ b/tests/testsuite/cargo_new/add_members_to_workspace_format_sorted/out/crates/foo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "foo" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_new/add_members_to_workspace_with_absolute_package_path/out/crates/foo/Cargo.toml b/tests/testsuite/cargo_new/add_members_to_workspace_with_absolute_package_path/out/crates/foo/Cargo.toml index 878c67291470..051260800079 100644 --- a/tests/testsuite/cargo_new/add_members_to_workspace_with_absolute_package_path/out/crates/foo/Cargo.toml +++ b/tests/testsuite/cargo_new/add_members_to_workspace_with_absolute_package_path/out/crates/foo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "foo" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_new/add_members_to_workspace_with_empty_members/out/crates/foo/Cargo.toml b/tests/testsuite/cargo_new/add_members_to_workspace_with_empty_members/out/crates/foo/Cargo.toml index 878c67291470..051260800079 100644 --- a/tests/testsuite/cargo_new/add_members_to_workspace_with_empty_members/out/crates/foo/Cargo.toml +++ b/tests/testsuite/cargo_new/add_members_to_workspace_with_empty_members/out/crates/foo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "foo" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_new/add_members_to_workspace_with_exclude_list/out/crates/foo/Cargo.toml b/tests/testsuite/cargo_new/add_members_to_workspace_with_exclude_list/out/crates/foo/Cargo.toml index 878c67291470..051260800079 100644 --- a/tests/testsuite/cargo_new/add_members_to_workspace_with_exclude_list/out/crates/foo/Cargo.toml +++ b/tests/testsuite/cargo_new/add_members_to_workspace_with_exclude_list/out/crates/foo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "foo" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_new/add_members_to_workspace_with_members_glob/out/crates/foo/Cargo.toml b/tests/testsuite/cargo_new/add_members_to_workspace_with_members_glob/out/crates/foo/Cargo.toml index 878c67291470..051260800079 100644 --- a/tests/testsuite/cargo_new/add_members_to_workspace_with_members_glob/out/crates/foo/Cargo.toml +++ b/tests/testsuite/cargo_new/add_members_to_workspace_with_members_glob/out/crates/foo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "foo" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_new/add_members_to_workspace_without_members/out/bar/Cargo.toml b/tests/testsuite/cargo_new/add_members_to_workspace_without_members/out/bar/Cargo.toml index fe23452f35a9..845311fc8065 100644 --- a/tests/testsuite/cargo_new/add_members_to_workspace_without_members/out/bar/Cargo.toml +++ b/tests/testsuite/cargo_new/add_members_to_workspace_without_members/out/bar/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bar" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_new/ignore_current_dir_workspace/out/out-of-workspace/Cargo.toml b/tests/testsuite/cargo_new/ignore_current_dir_workspace/out/out-of-workspace/Cargo.toml index e0fde467294a..c7dc68a9f379 100644 --- a/tests/testsuite/cargo_new/ignore_current_dir_workspace/out/out-of-workspace/Cargo.toml +++ b/tests/testsuite/cargo_new/ignore_current_dir_workspace/out/out-of-workspace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "out-of-workspace" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_new/inherit_workspace_lints/out/crates/foo/Cargo.toml b/tests/testsuite/cargo_new/inherit_workspace_lints/out/crates/foo/Cargo.toml index 836294e0da7b..e5e0f22462cb 100644 --- a/tests/testsuite/cargo_new/inherit_workspace_lints/out/crates/foo/Cargo.toml +++ b/tests/testsuite/cargo_new/inherit_workspace_lints/out/crates/foo/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "foo" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/cargo_new/inherit_workspace_package_table_with_edition/out/crates/foo/Cargo.toml b/tests/testsuite/cargo_new/inherit_workspace_package_table_with_edition/out/crates/foo/Cargo.toml index 90e45dafa85a..dd156239829d 100644 --- a/tests/testsuite/cargo_new/inherit_workspace_package_table_with_edition/out/crates/foo/Cargo.toml +++ b/tests/testsuite/cargo_new/inherit_workspace_package_table_with_edition/out/crates/foo/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "foo" -edition = "2021" +edition = "2024" authors.workspace = true description.workspace = true homepage.workspace = true diff --git a/tests/testsuite/cargo_new/not_inherit_workspace_package_table_if_not_members/out/bar/Cargo.toml b/tests/testsuite/cargo_new/not_inherit_workspace_package_table_if_not_members/out/bar/Cargo.toml index fe23452f35a9..845311fc8065 100644 --- a/tests/testsuite/cargo_new/not_inherit_workspace_package_table_if_not_members/out/bar/Cargo.toml +++ b/tests/testsuite/cargo_new/not_inherit_workspace_package_table_if_not_members/out/bar/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bar" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] diff --git a/tests/testsuite/check.rs b/tests/testsuite/check.rs index 36f95258cab1..cff23929cf64 100644 --- a/tests/testsuite/check.rs +++ b/tests/testsuite/check.rs @@ -1077,14 +1077,12 @@ fn warn_manifest_with_project() { .run(); } -#[cargo_test(nightly, reason = "edition2024")] +#[cargo_test] fn error_manifest_with_project_on_2024() { let p = project() .file( "Cargo.toml", r#" - cargo-features = ["edition2024"] - [project] name = "foo" version = "0.0.1" @@ -1095,7 +1093,6 @@ fn error_manifest_with_project_on_2024() { .build(); p.cargo("check") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_status(101) .with_stderr_data(str![[r#" [ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml` diff --git a/tests/testsuite/fix.rs b/tests/testsuite/fix.rs index 15fb306342cf..df60abcfba77 100644 --- a/tests/testsuite/fix.rs +++ b/tests/testsuite/fix.rs @@ -2361,8 +2361,6 @@ fn migrate_project_to_package() { .file( "Cargo.toml", r#" -cargo-features = ["edition2024"] - # Before project [ project ] # After project header # After project header line @@ -2375,7 +2373,6 @@ edition = "2021" .build(); p.cargo("fix --edition --allow-no-vcs") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_stderr_data(str![[r#" [MIGRATING] Cargo.toml from 2021 edition to 2024 [FIXED] Cargo.toml (1 fix) @@ -2389,8 +2386,6 @@ edition = "2021" p.read_file("Cargo.toml"), str![[r#" -cargo-features = ["edition2024"] - # Before project [ package ] # After project header # After project header line @@ -2408,8 +2403,6 @@ fn migrate_removes_project() { .file( "Cargo.toml", r#" -cargo-features = ["edition2024"] - # Before package [ package ] # After package header # After package header line @@ -2429,7 +2422,6 @@ edition = "2021" .build(); p.cargo("fix --edition --allow-no-vcs") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_stderr_data(str![[r#" [MIGRATING] Cargo.toml from 2021 edition to 2024 [FIXED] Cargo.toml (1 fix) @@ -2443,8 +2435,6 @@ edition = "2021" p.read_file("Cargo.toml"), str![[r#" -cargo-features = ["edition2024"] - # Before package [ package ] # After package header # After package header line @@ -2462,8 +2452,6 @@ fn migrate_rename_underscore_fields() { .file( "Cargo.toml", r#" -cargo-features = ["edition2024"] - [workspace.dependencies] # Before default_features a = {path = "a", default_features = false} # After default_features value @@ -2531,7 +2519,6 @@ a = {path = "a", default_features = false} .build(); p.cargo("fix --edition --allow-no-vcs") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_stderr_data(str![[r#" [MIGRATING] Cargo.toml from 2021 edition to 2024 [FIXED] Cargo.toml (11 fixes) @@ -2547,8 +2534,6 @@ a = {path = "a", default_features = false} p.read_file("Cargo.toml"), str![[r#" -cargo-features = ["edition2024"] - [workspace.dependencies] # Before default_features a = {path = "a", default-features = false} # After default_features value @@ -2691,7 +2676,6 @@ dep_df_false = { version = "0.1.0", default-features = false } .build(); p.cargo("fix --all --edition --allow-no-vcs") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_stderr_data( str![[r#" [MIGRATING] pkg_default/Cargo.toml from 2021 edition to 2024 diff --git a/tests/testsuite/inheritable_workspace_fields.rs b/tests/testsuite/inheritable_workspace_fields.rs index 7ac3252eb2ea..14e02aa831d5 100644 --- a/tests/testsuite/inheritable_workspace_fields.rs +++ b/tests/testsuite/inheritable_workspace_fields.rs @@ -1549,7 +1549,7 @@ fn warn_inherit_def_feat_true_member_def_feat_false() { "#]]).run(); } -#[cargo_test(nightly, reason = "edition2024 is not stable")] +#[cargo_test] fn warn_inherit_def_feat_true_member_def_feat_false_2024_edition() { Package::new("dep", "0.1.0") .feature("default", &["fancy_dep"]) @@ -1563,8 +1563,6 @@ fn warn_inherit_def_feat_true_member_def_feat_false_2024_edition() { .file( "Cargo.toml", r#" - cargo-features = ["edition2024"] - [package] name = "bar" version = "0.2.0" @@ -1583,7 +1581,6 @@ fn warn_inherit_def_feat_true_member_def_feat_false_2024_edition() { .build(); p.cargo("check") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_status(101) .with_stderr_data(str![[r#" [ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml` @@ -1644,7 +1641,7 @@ fn warn_inherit_simple_member_def_feat_false() { "#]]).run(); } -#[cargo_test(nightly, reason = "edition2024 is not stable")] +#[cargo_test] fn warn_inherit_simple_member_def_feat_false_2024_edition() { Package::new("dep", "0.1.0") .feature("default", &["fancy_dep"]) @@ -1658,8 +1655,6 @@ fn warn_inherit_simple_member_def_feat_false_2024_edition() { .file( "Cargo.toml", r#" - cargo-features = ["edition2024"] - [package] name = "bar" version = "0.2.0" @@ -1678,7 +1673,6 @@ fn warn_inherit_simple_member_def_feat_false_2024_edition() { .build(); p.cargo("check") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_status(101) .with_stderr_data(str![[r#" [ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml` diff --git a/tests/testsuite/lockfile_path.rs b/tests/testsuite/lockfile_path.rs index 45fc62a23fea..85d5b649cef4 100644 --- a/tests/testsuite/lockfile_path.rs +++ b/tests/testsuite/lockfile_path.rs @@ -525,7 +525,7 @@ fn run_embed() { .arg("src/main.rs") .with_status(101) .with_stderr_data(str![[ - r#"[WARNING] `package.edition` is unspecified, defaulting to `2021` + r#"[WARNING] `package.edition` is unspecified, defaulting to `2024` [ERROR] failed to parse lock file at: [ROOT]/foo/Cargo.lock ... diff --git a/tests/testsuite/rust_version.rs b/tests/testsuite/rust_version.rs index a1af79b6b601..ad8a20071ff3 100644 --- a/tests/testsuite/rust_version.rs +++ b/tests/testsuite/rust_version.rs @@ -515,7 +515,7 @@ higher v0.0.1 ([ROOT]/foo) .run(); } -#[cargo_test(nightly, reason = "edition2024 in rustc is unstable")] +#[cargo_test] fn resolve_edition2024() { Package::new("only-newer", "1.6.0") .rust_version("1.65.0") @@ -534,8 +534,6 @@ fn resolve_edition2024() { .file( "Cargo.toml", r#" - cargo-features = ["edition2024"] - [package] name = "foo" version = "0.0.1" @@ -553,7 +551,6 @@ fn resolve_edition2024() { // Edition2024 should resolve for MSRV p.cargo("generate-lockfile") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_stderr_data(str![[r#" [UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest Rust 1.60.0 compatible versions @@ -563,7 +560,6 @@ fn resolve_edition2024() { "#]]) .run(); p.cargo("tree") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_stdout_data(str![[r#" foo v0.0.1 ([ROOT]/foo) ├── newer-and-older v1.5.0 @@ -579,10 +575,8 @@ foo v0.0.1 ([ROOT]/foo) [LOCKING] 2 packages to latest compatible versions "#]]) - .masquerade_as_nightly_cargo(&["edition2024"]) .run(); p.cargo("tree") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_stdout_data(str![[r#" foo v0.0.1 ([ROOT]/foo) ├── newer-and-older v1.6.0 @@ -599,10 +593,8 @@ foo v0.0.1 ([ROOT]/foo) [LOCKING] 2 packages to latest compatible versions "#]]) - .masquerade_as_nightly_cargo(&["edition2024"]) .run(); p.cargo("tree") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_stdout_data(str![[r#" foo v0.0.1 ([ROOT]/foo) ├── newer-and-older v1.6.0 @@ -961,7 +953,7 @@ fn cargo_install_ignores_resolver_v3_msrv_change() { .run(); } -#[cargo_test(nightly, reason = "edition2024 in rustc is unstable")] +#[cargo_test] fn cargo_install_ignores_edition_2024_msrv_change() { Package::new("dep", "1.0.0") .rust_version("1.50") @@ -973,14 +965,12 @@ fn cargo_install_ignores_edition_2024_msrv_change() { .publish(); Package::new("foo", "0.0.1") .rust_version("1.60") - .cargo_feature("edition2024") .edition("2024") .file("src/main.rs", "fn main() {}") .dep("dep", "1") .publish(); cargo_process("install foo") - .masquerade_as_nightly_cargo(&["edition2024"]) .with_stderr_data(str![[r#" [UPDATING] `dummy-registry` index [DOWNLOADING] crates ... diff --git a/tests/testsuite/script.rs b/tests/testsuite/script.rs index 3adcd93f5693..fc6ba7492935 100644 --- a/tests/testsuite/script.rs +++ b/tests/testsuite/script.rs @@ -39,7 +39,7 @@ args: [] "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] echo v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/echo[EXE]` @@ -62,7 +62,7 @@ args: [] "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] echo v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/echo[EXE]` @@ -116,7 +116,7 @@ args: [] "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] echo v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/echo[EXE]` @@ -233,7 +233,7 @@ Hello world! "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/script[EXE]` @@ -261,7 +261,7 @@ msg = undefined "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/script[EXE]` @@ -277,7 +277,7 @@ msg = undefined "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/script[EXE]` @@ -293,7 +293,7 @@ msg = hello "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/script[EXE]` @@ -421,7 +421,7 @@ line: 4 "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/script[EXE]` @@ -445,7 +445,7 @@ args: ["-NotAnArg"] "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/script[EXE] -NotAnArg` @@ -469,7 +469,7 @@ args: ["-NotAnArg"] "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/script[EXE] -NotAnArg` @@ -493,7 +493,7 @@ args: ["--help"] "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/script[EXE] --help` @@ -517,7 +517,7 @@ args: [] "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] s-h-w-c- v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/s-h-w-c-[EXE]` @@ -541,7 +541,7 @@ args: [] "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] answer v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/answer[EXE]` @@ -563,7 +563,7 @@ args: [] "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] package v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/package[EXE]` @@ -709,7 +709,7 @@ Hello world! "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [UPDATING] `dummy-registry` index [LOCKING] 1 package to latest compatible version [DOWNLOADING] crates ... @@ -748,7 +748,7 @@ Hello world! "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [LOCKING] 1 package to latest compatible version [COMPILING] bar v0.0.1 ([ROOT]/foo/bar) [COMPILING] script v0.0.0 ([ROOT]/foo) @@ -778,7 +778,7 @@ Hello world! "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/script[EXE] --help` @@ -806,7 +806,7 @@ Hello world! "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/script[EXE] --help` @@ -834,7 +834,7 @@ Hello world! "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/script[EXE] --help` @@ -858,7 +858,7 @@ args: [] "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/script[EXE]` @@ -885,7 +885,7 @@ args: [] "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/script[EXE]` @@ -942,7 +942,7 @@ fn cmd_check_with_embedded() { .masquerade_as_nightly_cargo(&["script"]) .with_stdout_data("") .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [CHECKING] script v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s @@ -991,7 +991,7 @@ fn cmd_build_with_embedded() { .masquerade_as_nightly_cargo(&["script"]) .with_stdout_data("") .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s @@ -1018,7 +1018,7 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; fini "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] unittests script.rs ([ROOT]/home/.cargo/target/[HASH]/debug/deps/script-[HASH][EXE]) @@ -1043,7 +1043,7 @@ fn cmd_clean_with_embedded() { .masquerade_as_nightly_cargo(&["script"]) .with_stdout_data("") .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [REMOVED] [FILE_NUM] files, [FILE_SIZE]B total "#]]) @@ -1061,7 +1061,7 @@ fn cmd_generate_lockfile_with_embedded() { .masquerade_as_nightly_cargo(&["script"]) .with_stdout_data("") .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` "#]]) .run(); @@ -1088,7 +1088,7 @@ fn cmd_metadata_with_embedded() { "dependencies": [], "description": null, "documentation": null, - "edition": "2021", + "edition": "2024", "features": {}, "homepage": null, "id": "path+[ROOTURL]/foo#script@0.0.0", @@ -1111,7 +1111,7 @@ fn cmd_metadata_with_embedded() { ], "doc": true, "doctest": false, - "edition": "2021", + "edition": "2024", "kind": [ "bin" ], @@ -1148,7 +1148,7 @@ fn cmd_metadata_with_embedded() { .is_json(), ) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` "#]]) .run(); @@ -1172,7 +1172,7 @@ fn cmd_read_manifest_with_embedded() { "dependencies": [], "description": null, "documentation": null, - "edition": "2021", + "edition": "2024", "features": {}, "homepage": null, "id": "path+[ROOTURL]/foo#script@0.0.0", @@ -1195,7 +1195,7 @@ fn cmd_read_manifest_with_embedded() { ], "doc": true, "doctest": false, - "edition": "2021", + "edition": "2024", "kind": [ "bin" ], @@ -1210,7 +1210,7 @@ fn cmd_read_manifest_with_embedded() { .is_json(), ) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` "#]]) .run(); @@ -1230,7 +1230,7 @@ args: [] "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/script[EXE]` @@ -1252,7 +1252,7 @@ script v0.0.0 ([ROOT]/foo) "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` "#]]) .run(); @@ -1268,7 +1268,7 @@ fn cmd_update_with_embedded() { .masquerade_as_nightly_cargo(&["script"]) .with_stdout_data("") .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` "#]]) .run(); @@ -1291,7 +1291,7 @@ fn cmd_verify_project_with_embedded() { .is_json(), ) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` "#]]) .run(); @@ -1307,7 +1307,7 @@ fn cmd_pkgid_with_embedded() { .masquerade_as_nightly_cargo(&["script"]) .with_status(101) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [ERROR] [ROOT]/foo/script.rs is unsupported by `cargo pkgid` "#]]) @@ -1324,7 +1324,7 @@ fn cmd_package_with_embedded() { .masquerade_as_nightly_cargo(&["script"]) .with_status(101) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [ERROR] [ROOT]/foo/script.rs is unsupported by `cargo package` "#]]) @@ -1341,7 +1341,7 @@ fn cmd_publish_with_embedded() { .masquerade_as_nightly_cargo(&["script"]) .with_status(101) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [ERROR] [ROOT]/foo/script.rs is unsupported by `cargo publish` "#]]) @@ -1369,7 +1369,7 @@ CARGO_MANIFEST_PATH: [ROOT]/foo/script.rs "#]]) .with_stderr_data(str![[r#" -[WARNING] `package.edition` is unspecified, defaulting to `2021` +[WARNING] `package.edition` is unspecified, defaulting to `2024` [COMPILING] script v0.0.0 ([ROOT]/foo) [FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s [RUNNING] `[ROOT]/home/.cargo/target/[HASH]/debug/script[EXE]`