diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2023-12-11 11:40:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-11 11:40:36 +0100 |
| commit | 948c9047d56e95a72c50f623b561b71b0d0ee9ae (patch) | |
| tree | e6a99e25c665b1a8ad98b262a1cea5e54b7d02af | |
| parent | 1cb804b52036fc6bdc02eac478c95e54212ab50c (diff) | |
| parent | b9ad02421a0a4d04394170c285f094b75594191f (diff) | |
| download | rust-948c9047d56e95a72c50f623b561b71b0d0ee9ae.tar.gz rust-948c9047d56e95a72c50f623b561b71b0d0ee9ae.zip | |
Rollup merge of #118802 - ehuss:remove-edition-preview, r=TaKO8Ki
Remove edition umbrella features. In the 2018 edition, there was an "umbrella" feature `#[feature(rust_2018_preview)]` which was used to enable several other features at once. This umbrella mechanism was not used in the 2021 edition and likely will not be used in 2024 either. During 2018 users reported that setting the feature was awkward, especially since they already needed to opt-in via the edition mechanism. This PR removes this mechanism because I believe it will not be used (and will clean up and simplify the code). I believe that there are better ways to handle features and editions. In short: - For highly experimental features, that may or may not be involved in an edition, they can implement regular feature gates like `tcx.features().my_feature`. - For experimental features that *might* be involved in an edition, they should implement gates with `tcx.features().my_feature && span.at_least_rust_20xx()`. This requires the user to still specify `#![feature(my_feature)]`, to avoid disrupting testing of other edition features which are ready and have been accepted within the edition. - For experimental features that have graduated to definitely be part of an edition, they should implement gates with `tcx.features().my_feature || span.at_least_rust_20xx()`, or just remove the feature check altogether and just check `span.at_least_rust_20xx()`. - For relatively simple changes, they can skip the whole feature gating thing and just check `span.at_least_rust_20xx()`, and rely on the instability of the edition itself (which requires `-Zunstable-options`) to gate it. I am working on documenting all of this in the rustc-dev-guide.
| -rw-r--r-- | tests/source/issue-2927-2.rs | 2 | ||||
| -rw-r--r-- | tests/source/issue-2927.rs | 2 | ||||
| -rw-r--r-- | tests/target/issue-2927-2.rs | 2 | ||||
| -rw-r--r-- | tests/target/issue-2927.rs | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/tests/source/issue-2927-2.rs b/tests/source/issue-2927-2.rs index d87761fdc9c..07afef38cf5 100644 --- a/tests/source/issue-2927-2.rs +++ b/tests/source/issue-2927-2.rs @@ -1,5 +1,5 @@ // rustfmt-edition: 2015 -#![feature(rust_2018_preview, uniform_paths)] +#![feature(uniform_paths)] use futures::prelude::*; use http_03::cli::Cli; use hyper::{service::service_fn_ok, Body, Response, Server}; diff --git a/tests/source/issue-2927.rs b/tests/source/issue-2927.rs index a7df32084f3..c7ec7bb0855 100644 --- a/tests/source/issue-2927.rs +++ b/tests/source/issue-2927.rs @@ -1,5 +1,5 @@ // rustfmt-edition: 2018 -#![feature(rust_2018_preview, uniform_paths)] +#![feature(uniform_paths)] use futures::prelude::*; use http_03::cli::Cli; use hyper::{service::service_fn_ok, Body, Response, Server}; diff --git a/tests/target/issue-2927-2.rs b/tests/target/issue-2927-2.rs index e895783ba8b..46e0bf0e989 100644 --- a/tests/target/issue-2927-2.rs +++ b/tests/target/issue-2927-2.rs @@ -1,5 +1,5 @@ // rustfmt-edition: 2015 -#![feature(rust_2018_preview, uniform_paths)] +#![feature(uniform_paths)] use futures::prelude::*; use http_03::cli::Cli; use hyper::{service::service_fn_ok, Body, Response, Server}; diff --git a/tests/target/issue-2927.rs b/tests/target/issue-2927.rs index 3267be28d7b..56afc2d3e40 100644 --- a/tests/target/issue-2927.rs +++ b/tests/target/issue-2927.rs @@ -1,5 +1,5 @@ // rustfmt-edition: 2018 -#![feature(rust_2018_preview, uniform_paths)] +#![feature(uniform_paths)] use ::log::{error, info, log}; use futures::prelude::*; use http_03::cli::Cli; |
