feat: Stabilize Edition 2024

This commit is contained in:
Ed Page 2024-11-15 12:37:55 -06:00
parent 52c62ee9fe
commit 81411ec545
66 changed files with 165 additions and 259 deletions

View File

@ -202,9 +202,9 @@ impl Edition {
/// The latest edition that is unstable.
///
/// This is `None` if there is no next unstable edition.
pub const LATEST_UNSTABLE: Option<Edition> = Some(Edition::Edition2024);
pub const LATEST_UNSTABLE: Option<Edition> = 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,
@ -225,7 +225,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)),
}
}
@ -236,7 +236,7 @@ impl Edition {
Edition2015 => true,
Edition2018 => true,
Edition2021 => true,
Edition2024 => false,
Edition2024 => true,
}
}
@ -509,7 +509,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/manifest.html#the-edition-field"),
/// 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"),

View File

@ -567,7 +567,7 @@ autoexamples = false
autolib = false
autotests = false
build = false
edition = "2021"
edition = "2024"
name = "test-"
[profile.release]
@ -605,7 +605,7 @@ autoexamples = false
autolib = false
autotests = false
build = false
edition = "2021"
edition = "2024"
name = "test-"
[profile.release]

View File

@ -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",

View File

@ -30,7 +30,7 @@ OPTIONS
Create a package with a library target (src/lib.rs).
--edition edition
Specify the Rust edition to use. Default is 2021. Possible values:
Specify the Rust edition to use. Default is 2024. Possible values:
2015, 2018, 2021, 2024
--name name

View File

@ -25,7 +25,7 @@ OPTIONS
Create a package with a library target (src/lib.rs).
--edition edition
Specify the Rust edition to use. Default is 2021. Possible values:
Specify the Rust edition to use. Default is 2024. Possible values:
2015, 2018, 2021, 2024
--name name

View File

@ -10,7 +10,7 @@ Create a package with a library target (`src/lib.rs`).
{{/option}}
{{#option "`--edition` _edition_" }}
Specify the Rust edition to use. Default is 2021.
Specify the Rust edition to use. Default is 2024.
Possible values: 2015, 2018, 2021, 2024
{{/option}}

View File

@ -39,7 +39,7 @@ This is the default behavior.</dd>
<dt class="option-term" id="option-cargo-init---edition"><a class="option-anchor" href="#option-cargo-init---edition"></a><code>--edition</code> <em>edition</em></dt>
<dd class="option-desc">Specify the Rust edition to use. Default is 2021.
<dd class="option-desc">Specify the Rust edition to use. Default is 2024.
Possible values: 2015, 2018, 2021, 2024</dd>

View File

@ -34,7 +34,7 @@ This is the default behavior.</dd>
<dt class="option-term" id="option-cargo-new---edition"><a class="option-anchor" href="#option-cargo-new---edition"></a><code>--edition</code> <em>edition</em></dt>
<dd class="option-desc">Specify the Rust edition to use. Default is 2021.
<dd class="option-desc">Specify the Rust edition to use. Default is 2024.
Possible values: 2015, 2018, 2021, 2024</dd>

View File

@ -33,7 +33,7 @@ This is all we need to get started. First, lets check out `Cargo.toml`:
[package]
name = "hello_world"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]
```

View File

@ -29,7 +29,7 @@ Lets take a closer look at `Cargo.toml`:
[package]
name = "hello_world"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -35,7 +35,7 @@ crates:
[package]
name = "hello_world"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]
time = "0.1.12"

View File

@ -49,7 +49,7 @@ Here we can see that we have a `build.rs` build script and our binary in
[package]
name = "hello-from-generated-code"
version = "0.1.0"
edition = "2021"
edition = "2024"
```
Lets see whats inside the build script:
@ -148,7 +148,7 @@ Pretty similar to before! Next, the manifest:
[package]
name = "hello-world-from-c"
version = "0.1.0"
edition = "2021"
edition = "2024"
```
For now were not going to use any build dependencies, so lets take a look at
@ -298,7 +298,7 @@ with `pkg-config` installed. Let's start by setting up the manifest:
[package]
name = "libz-sys"
version = "0.1.0"
edition = "2021"
edition = "2024"
links = "z"
[build-dependencies]
@ -385,7 +385,7 @@ Here's an example:
[package]
name = "zuser"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]
libz-sys = "1.0.25"

View File

@ -151,12 +151,12 @@ examples, etc.
```toml
[package]
# ...
edition = '2021'
edition = '2024'
```
Most manifests have the `edition` field filled in automatically by [`cargo new`]
with the latest stable edition. By default `cargo new` creates a manifest with
the 2021 edition currently.
the 2024 edition currently.
If the `edition` field is not present in `Cargo.toml`, then the 2015 edition is
assumed for backwards compatibility. Note that all manifests

View File

@ -38,7 +38,7 @@ in `Cargo.toml`:
[package]
name = "my-project"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]
other-crate = { version = "1.0", registry = "my-registry" }

View File

@ -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

View File

@ -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 <path>` and `cargo <path>`
### 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.

View File

@ -76,7 +76,7 @@ resolver = "2"
[package]
name = "hello_world" # the name of the package
version = "0.1.0" # the current version, obeying semver
edition = "2021" # the edition, will have no effect on a resolver used in the workspace
edition = "2024" # the edition, will have no effect on a resolver used in the workspace
authors = ["Alice <a@example.com>", "Bob <b@example.com>"]
```

View File

@ -36,7 +36,7 @@ Create a package with a library target (\fBsrc/lib.rs\fR).
.sp
\fB\-\-edition\fR \fIedition\fR
.RS 4
Specify the Rust edition to use. Default is 2021.
Specify the Rust edition to use. Default is 2024.
Possible values: 2015, 2018, 2021, 2024
.RE
.sp

View File

@ -31,7 +31,7 @@ Create a package with a library target (\fBsrc/lib.rs\fR).
.sp
\fB\-\-edition\fR \fIedition\fR
.RS 4
Specify the Rust edition to use. Default is 2021.
Specify the Rust edition to use. Default is 2024.
Possible values: 2015, 2018, 2021, 2024
.RE
.sp

View File

@ -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`

View File

@ -1,6 +1,6 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,7 +1,7 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,7 +1,7 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,7 +1,7 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,7 +1,7 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,7 +1,7 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,7 +1,7 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,7 +1,7 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "foo"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,7 +1,7 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,7 +1,7 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,7 +1,7 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "case"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "foo"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "foo"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "bar"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,7 +1,7 @@
[package]
name = "foo"
version = "0.1.0"
edition = "2021"
edition = "2024"
authors.workspace = true
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "foo"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "foo"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "foo"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "foo"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "foo"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "bar"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "out-of-workspace"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,7 +1,7 @@
[package]
name = "foo"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "bar"
version = "0.1.0"
edition = "2021"
edition = "2024"
[dependencies]

View File

@ -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`

View File

@ -135,7 +135,7 @@ fn unset_edition_with_unset_rust_version() {
p.cargo("check -v")
.with_stderr_data(str![[r#"
[WARNING] no edition set: defaulting to the 2015 edition while the latest is 2021
[WARNING] no edition set: defaulting to the 2015 edition while the latest is 2024
[CHECKING] foo v0.1.0 ([ROOT]/foo)
[RUNNING] `rustc [..] --edition=2015 [..]`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s

View File

@ -869,7 +869,7 @@ fn prepare_for_already_on_latest_unstable() {
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn prepare_for_already_on_latest_stable() {
// Stable counterpart of prepare_for_already_on_latest_unstable.
if Edition::LATEST_UNSTABLE.is_some() {
@ -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

View File

@ -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`

View File

@ -494,7 +494,7 @@ fn install_lock_file_path_must_present() {
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn run_embed() {
let lockfile_path = "mylockfile/Cargo.lock";
let invalid_lockfile = "Cargo.lock";
@ -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
...

View File

@ -393,7 +393,7 @@ fn new_with_edition_2018() {
fn new_default_edition() {
cargo_process("new foo").run();
let manifest = fs::read_to_string(paths::root().join("foo/Cargo.toml")).unwrap();
assert!(manifest.contains("edition = \"2021\""));
assert!(manifest.contains("edition = \"2024\""));
}
#[cargo_test]
@ -407,7 +407,7 @@ fn new_with_bad_edition() {
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn lockfile_constant_during_new() {
cargo_process("new foo").run();

View File

@ -160,7 +160,7 @@ See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for
[PACKAGING] foo v0.0.1 ([ROOT]/foo)
[PACKAGED] 4 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
[VERIFYING] foo v0.0.1 ([ROOT]/foo)
[WARNING] no edition set: defaulting to the 2015 edition while the latest is 2021
[WARNING] no edition set: defaulting to the 2015 edition while the latest is 2024
[COMPILING] foo v0.0.1 ([ROOT]/foo/target/package/foo-0.0.1)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
[UPLOADING] foo v0.0.1 ([ROOT]/foo)

View File

@ -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.90.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.85.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
@ -581,10 +577,8 @@ foo v0.0.1 ([ROOT]/foo)
[ADDING] only-newer v1.6.0 (requires Rust 1.90.0)
"#]])
.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
@ -603,10 +597,8 @@ foo v0.0.1 ([ROOT]/foo)
[ADDING] only-newer v1.6.0 (requires Rust 1.90.0)
"#]])
.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

View File

@ -25,7 +25,7 @@ fn path() -> Vec<std::path::PathBuf> {
std::env::split_paths(&std::env::var_os("PATH").unwrap_or_default()).collect()
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn basic_rs() {
let p = cargo_test_support::project()
.file("echo.rs", ECHO_SCRIPT)
@ -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]`
@ -48,7 +48,7 @@ args: []
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn basic_path() {
let p = cargo_test_support::project()
.file("echo", ECHO_SCRIPT)
@ -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]`
@ -94,7 +94,7 @@ fn path_required() {
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
#[cfg(unix)]
fn manifest_precedence_over_plugins() {
let p = cargo_test_support::project()
@ -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]`
@ -125,7 +125,7 @@ args: []
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
#[cfg(unix)]
fn warn_when_plugin_masks_manifest_on_stable() {
let p = cargo_test_support::project()
@ -182,7 +182,7 @@ fn requires_z_flag() {
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn clean_output_with_edition() {
let script = r#"#!/usr/bin/env cargo
---
@ -212,7 +212,7 @@ Hello world!
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn warning_without_edition() {
let script = r#"#!/usr/bin/env cargo
---
@ -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]`
@ -242,7 +242,7 @@ Hello world!
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn rebuild() {
let script = r#"#!/usr/bin/env cargo-eval
@ -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]`
@ -302,7 +302,7 @@ msg = hello
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn use_cargo_home_config() {
let script = ECHO_SCRIPT;
let _ = cargo_test_support::project()
@ -366,7 +366,7 @@ Caused by:
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn default_programmatic_verbosity() {
let script = ECHO_SCRIPT;
let p = cargo_test_support::project()
@ -384,7 +384,7 @@ args: ["-NotAnArg"]
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn quiet() {
let script = ECHO_SCRIPT;
let p = cargo_test_support::project()
@ -402,7 +402,7 @@ args: ["-NotAnArg"]
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn test_line_numbering_preserved() {
let script = r#"#!/usr/bin/env cargo
@ -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]`
@ -430,7 +430,7 @@ line: 4
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn test_escaped_hyphen_arg() {
let script = ECHO_SCRIPT;
let p = cargo_test_support::project()
@ -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`
@ -454,7 +454,7 @@ args: ["-NotAnArg"]
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn test_unescaped_hyphen_arg() {
let script = ECHO_SCRIPT;
let p = cargo_test_support::project()
@ -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`
@ -478,7 +478,7 @@ args: ["-NotAnArg"]
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn test_same_flags() {
let script = ECHO_SCRIPT;
let p = cargo_test_support::project()
@ -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`
@ -502,7 +502,7 @@ args: ["--help"]
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn test_name_has_weird_chars() {
let script = ECHO_SCRIPT;
let p = cargo_test_support::project()
@ -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]`
@ -526,7 +526,7 @@ args: []
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn test_name_has_leading_number() {
let script = ECHO_SCRIPT;
let p = cargo_test_support::project()
@ -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]`
@ -550,7 +550,7 @@ args: []
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn test_name_is_number() {
let script = ECHO_SCRIPT;
let p = cargo_test_support::project().file("42.rs", script).build();
@ -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]`
@ -686,7 +686,7 @@ fn did_you_mean_command_stable() {
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn test_name_same_as_dependency() {
Package::new("script", "1.0.0").publish();
let script = r#"#!/usr/bin/env cargo
@ -709,9 +709,9 @@ 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
[LOCKING] 1 package to latest Rust [..] compatible version
[DOWNLOADING] crates ...
[DOWNLOADED] script v1.0.0 (registry `dummy-registry`)
[COMPILING] script v1.0.0
@ -723,7 +723,7 @@ Hello world!
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn test_path_dep() {
let script = r#"#!/usr/bin/env cargo
---
@ -748,8 +748,8 @@ Hello world!
"#]])
.with_stderr_data(str![[r#"
[WARNING] `package.edition` is unspecified, defaulting to `2021`
[LOCKING] 1 package to latest compatible version
[WARNING] `package.edition` is unspecified, defaulting to `2024`
[LOCKING] 1 package to latest Rust [..] compatible version
[COMPILING] bar v0.0.1 ([ROOT]/foo/bar)
[COMPILING] script v0.0.0 ([ROOT]/foo)
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
@ -759,7 +759,7 @@ Hello world!
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn test_no_build_rs() {
let script = r#"#!/usr/bin/env cargo
@ -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`
@ -787,7 +787,7 @@ Hello world!
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn test_no_autobins() {
let script = r#"#!/usr/bin/env cargo
@ -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`
@ -815,7 +815,7 @@ Hello world!
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn test_no_autolib() {
let script = r#"#!/usr/bin/env cargo
@ -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`
@ -843,7 +843,7 @@ Hello world!
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn implicit_target_dir() {
let script = ECHO_SCRIPT;
let p = cargo_test_support::project()
@ -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]`
@ -867,7 +867,7 @@ args: []
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn no_local_lockfile() {
let script = ECHO_SCRIPT;
let p = cargo_test_support::project()
@ -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]`
@ -931,7 +931,7 @@ fn cmd_check_requires_z_flag() {
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn cmd_check_with_embedded() {
let script = ECHO_SCRIPT;
let p = cargo_test_support::project()
@ -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
@ -980,7 +980,7 @@ fn cmd_check_with_missing_script() {
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn cmd_build_with_embedded() {
let script = ECHO_SCRIPT;
let p = cargo_test_support::project()
@ -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
@ -999,7 +999,7 @@ fn cmd_build_with_embedded() {
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn cmd_test_with_embedded() {
let script = ECHO_SCRIPT;
let p = cargo_test_support::project()
@ -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])
@ -1027,7 +1027,7 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; fini
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn cmd_clean_with_embedded() {
let script = ECHO_SCRIPT;
let p = cargo_test_support::project()
@ -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,13 +1210,13 @@ 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();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn cmd_run_with_embedded() {
let p = cargo_test_support::project()
.file("script.rs", ECHO_SCRIPT)
@ -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,14 +1341,14 @@ 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`
"#]])
.run();
}
#[cargo_test]
#[cargo_test(nightly, reason = "edition2024 hasn't hit stable yet")]
fn manifest_path_env() {
let p = cargo_test_support::project()
.file(
@ -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]`