-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
rustc_feature: Separate "renamed" features from "removed" features
#155129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nik-rev
wants to merge
2
commits into
rust-lang:main
Choose a base branch
from
nik-contrib:renamed-features
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| //! List of the renamed feature gates. | ||
|
|
||
| use std::num::NonZero; | ||
|
|
||
| use rustc_span::sym; | ||
|
|
||
| use super::{Feature, to_nonzero}; | ||
| use crate::opt_nonzero_u32; | ||
|
|
||
| pub struct RenamedFeature { | ||
| pub feature: Feature, | ||
| pub new_name: &'static str, | ||
| pub pull: Option<NonZero<u32>>, | ||
| } | ||
|
|
||
| macro_rules! declare_features { | ||
| ($( | ||
| $(#[doc = $doc:tt])* (renamed, $old_feature_name:ident => $new_feature_name:ident, $ver:expr, $issue:expr $(, $pull:expr)?), | ||
| )+) => { | ||
| /// Features that have been renamed. | ||
| pub static RENAMED_LANG_FEATURES: &[RenamedFeature] = &[ | ||
| $(RenamedFeature { | ||
| feature: Feature { | ||
| name: sym::$old_feature_name, | ||
| since: $ver, | ||
| issue: to_nonzero($issue), | ||
| }, | ||
| new_name: stringify!($new_feature_name), | ||
| pull: opt_nonzero_u32!($($pull)?), | ||
| }),+ | ||
| ]; | ||
| }; | ||
| } | ||
|
|
||
| #[rustfmt::skip] | ||
| declare_features! { | ||
| // ------------------------------------------------------------------------- | ||
| // feature-group-start: renamed features | ||
| // ------------------------------------------------------------------------- | ||
|
|
||
| // Note that the version indicates when it got *renamed*. | ||
| // | ||
| // When renaming a feature, set the version number to | ||
| // `CURRENT RUSTC VERSION` with ` ` replaced by `_`. | ||
|
|
||
| (renamed, abi_c_cmse_nonsecure_call => abi_cmse_nonsecure_call, "1.90.0", Some(81391), 142146), | ||
| /// Allows non-trivial generic constants which have to be manually propagated upwards. | ||
| (renamed, const_evaluatable_checked => generic_const_exprs, "1.56.0", Some(76560), 88369), | ||
| /// Allows `#[doc(spotlight)]`. | ||
| /// The attribute was renamed to `#[doc(notable_trait)]` | ||
| /// and the feature to `doc_notable_trait`. | ||
| (renamed, doc_spotlight => doc_notable_trait, "1.53.0", Some(45040), 80965), | ||
| /// Allows generators to be cloned. | ||
| (renamed, generator_clone => coroutine_clone, "1.75.0", Some(95360), 116958), | ||
| /// Allows defining generators. | ||
| (renamed, generators => coroutines, "1.75.0", Some(43122), 116958), | ||
| /// Allows `#[no_coverage]` on functions. | ||
| /// The feature was renamed to `coverage_attribute` and the attribute to `#[coverage(on|off)]` | ||
| (renamed, no_coverage => coverage_attribute, "1.74.0", Some(84605), 114656), | ||
| // Allows the use of `no_sanitize` attribute. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should it be a doc comment? |
||
| /// The feature was renamed to `sanitize` and the attribute to `#[sanitize(xyz = "on|off")]` | ||
| (renamed, no_sanitize => sanitize, "1.91.0", Some(39699), 142681), | ||
| /// Allows making `dyn Trait` well-formed even if `Trait` is not dyn compatible (object safe). | ||
| /// Renamed to `dyn_compatible_for_dispatch`. | ||
| (renamed, object_safe_for_dispatch => dyn_compatible_for_dispatch, "1.83.0", Some(43561), 131511), | ||
| /// Allows features specific to OIBIT (now called auto traits). | ||
| /// Renamed to `auto_traits`. | ||
| (renamed, optin_builtin_traits => auto_traits, "1.50.0", Some(13231), 79336), | ||
|
|
||
| // ------------------------------------------------------------------------- | ||
| // feature-group-end: renamed features | ||
| // ------------------------------------------------------------------------- | ||
|
|
||
|
|
||
| // ------------------------------------------------------------------------- | ||
| // feature-group-start: renamed library features | ||
| // ------------------------------------------------------------------------- | ||
| // | ||
| // FIXME(#141617): we should have a better way to track renamed library features, but we reuse | ||
| // the infrastructure here so users still get hints. The symbols used here can be remove from | ||
| // `symbol.rs` when that happens. | ||
|
|
||
| // ------------------------------------------------------------------------- | ||
| // feature-group-end: renamed library features | ||
| // ------------------------------------------------------------------------- | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this label duplicates a message from diag
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
old diagnostic had the same label and diagnostic message, so I just mirrored that:
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, let's drop it from both in a follow up, or remvoe it from renamed now and from removed in a follow up, smth like this