-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Tracking the old name of renamed unstable library features #142158
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: xizheyin <[email protected]>
|
Changes to the size of AST and/or HIR nodes. cc @nnethercote Some changes occurred in compiler/rustc_attr_data_structures Some changes occurred in compiler/rustc_attr_parsing |
for (feature, since) in defined_features.to_sorted_vec() { | ||
if let FeatureStability::AcceptedSince(since) = since | ||
for (feature, stability) in defined_features.to_sorted_vec() { | ||
if let FeatureStability::AcceptedSince(since) = stability |
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.
Naming it since
is not accurate here, the attribute here may be unstable. So I renamed it to stability
.
if let FeatureStability::Unstable(Some(alias)) = stability { | ||
if let Some(span) = remaining_lib_features.swap_remove(&alias) { | ||
tcx.dcx().emit_err(errors::RenamedFeature { span, feature, alias }); | ||
} | ||
} | ||
|
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.
In check_features
, check if any of the defined features have alias the same as the #![feature(...)]
-declared feature, and if they do, remove them and issue an error. This way, it won't issue the unknown features
error later.
library/core/src/ops/control_flow.rs
Outdated
@@ -98,7 +98,7 @@ pub enum ControlFlow<B, C = ()> { | |||
// is a no-op conversion in the `Try` implementation. | |||
} | |||
|
|||
#[unstable(feature = "try_trait_v2", issue = "84277")] | |||
#[unstable(feature = "try_trait_v2", issue = "84277", alias = "try_trait")] |
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.
I'm currently using try_trait
as an example, I'm trying to find out what other features have been renamed in the standard library, I also found slice_internals_v2
, but that may not be enough.
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.
alias
has been replaced with old_name
.
library/core/src/ops/try_trait.rs
Outdated
@@ -112,7 +112,7 @@ use crate::ops::ControlFlow; | |||
/// R::from_output(accum) | |||
/// } | |||
/// ``` | |||
#[unstable(feature = "try_trait_v2", issue = "84277")] | |||
#[unstable(feature = "try_trait_v2", issue = "84277", alias = "try_trait")] |
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.
I think "alias" is a bit misleading. It's not an alias that can be used, it's the previous name that can no longer be used. I'd call it previous_name
or something like that to make it clear what it is.
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.
Thanks for advice, I change it to old_name
, which would be shorter than previous_name
and presents the same meaning.
Signed-off-by: xizheyin <[email protected]>
This PR resolves the first problem of #141617 : tracking renamed unstable features. The first commit is to add a ui test, and the second one tracks the changes. I will comment on the code for clarification.
r? @jdonszelmann
There have been a lot of PR's reviewed by you lately, thanks for your time!
cc @jyn514