You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds support for the "future" edition which was added to rustc in
rust-lang/rust#137606.
To enable support for unstable editions, this introduces a new
`unstable-editions` cargo feature. The intent is that instead of having
a new feature for each edition that we reuse this feature for all new
editions. I don't see a particular reason we should have a separate one
for each edition, and this helps a bit with scalability and simplifies
some of the edition process.
This also includes a change to rework `supports_compat_lint` explained
in the comment.
Copy file name to clipboardExpand all lines: src/doc/src/reference/unstable.md
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -107,6 +107,7 @@ Each new feature described below should explain how to use it.
107
107
*[Profile `trim-paths` option](#profile-trim-paths-option) --- Control the sanitization of file paths in build outputs.
108
108
*[`[lints.cargo]`](#lintscargo) --- Allows configuring lints for Cargo.
109
109
*[path bases](#path-bases) --- Named base directories for path dependencies.
110
+
*[`unstable-editions`](#unstable-editions) --- Allows use of editions that are not yet stable.
110
111
* Information and metadata
111
112
*[Build-plan](#build-plan) --- Emits JSON information on which commands will be run.
112
113
*[unit-graph](#unit-graph) --- Emits JSON for Cargo's internal graph structure.
@@ -1898,6 +1899,22 @@ be stored in `.rmeta` files.
1898
1899
cargo +nightly -Zno-embed-metadata build
1899
1900
```
1900
1901
1902
+
## `unstable-editions`
1903
+
1904
+
The `unstable-editions` value in the `cargo-features` list allows a `Cargo.toml` manifest to specify an edition that is not yet stable.
1905
+
1906
+
```toml
1907
+
cargo-features = ["unstable-editions"]
1908
+
1909
+
[package]
1910
+
name = "my-package"
1911
+
edition = "future"
1912
+
```
1913
+
1914
+
When new editions are introduced, the `unstable-editions` feature is required until the edition is stabilized.
1915
+
1916
+
The special "future" edition is a home for new features that are under development, and is permanently unstable. The "future" edition also has no new behavior by itself. Each change in the future edition requires an opt-in such as a `#![feature(...)]` attribute.
[ERROR] failed to parse manifest at `[ROOT]/foo/Cargo.toml`
233
+
234
+
Caused by:
235
+
feature `unstable-editions` is required
236
+
237
+
The package requires the Cargo feature called `unstable-editions`, but that feature is not stabilized in this version of Cargo ([..]).
238
+
Consider adding `cargo-features = ["unstable-editions"]` to the top of Cargo.toml (above the [package] table) to tell Cargo you are opting in to use this unstable feature.
239
+
See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#unstable-editions for more information about the status of this feature.
240
+
241
+
"#]])
242
+
.run();
243
+
}
244
+
245
+
#[cargo_test(nightly, reason = "future edition is always unstable")]
0 commit comments