Skip to content

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

Merged
merged 2 commits into from
Jun 13, 2025

Conversation

xizheyin
Copy link
Contributor

@xizheyin xizheyin commented Jun 7, 2025

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

@rustbot
Copy link
Collaborator

rustbot commented Jun 7, 2025

jdonszelmann is currently at their maximum review capacity.
They may take a while to respond.

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jun 7, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 7, 2025

Changes to the size of AST and/or HIR nodes.

cc @nnethercote

Some changes occurred in compiler/rustc_attr_data_structures

cc @jdonszelmann

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann

@xizheyin xizheyin changed the title 141617 Tracking the old name of renamed unstable library attribute Jun 7, 2025
@xizheyin xizheyin changed the title Tracking the old name of renamed unstable library attribute Tracking the old name of renamed unstable library features Jun 7, 2025
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
Copy link
Contributor Author

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.

Comment on lines 1185 to 1190
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 });
}
}

Copy link
Contributor Author

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.

@@ -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")]
Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@@ -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")]
Copy link
Member

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.

Copy link
Contributor Author

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.

@@ -12,7 +12,7 @@ pub mod lib_features {
#[derive(HashStable, TyEncodable, TyDecodable)]
pub enum FeatureStability {
AcceptedSince(Symbol),
Unstable,
Unstable(Option<Symbol>),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's nicer I think if this is a named variant with old_name in it. I wouldn't know what this meant otherwise. AcceptedSince is clearer in that regard so is fine staying the way it is. Ping me after that and I'll r+ @rusbot author

@jdonszelmann
Copy link
Contributor

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 12, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 12, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@xizheyin
Copy link
Contributor Author

I revised it. 😊 @jdonszelmann
@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 12, 2025
@jdonszelmann
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 12, 2025

📌 Commit b8066f9 has been approved by jdonszelmann

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 12, 2025
bors added a commit that referenced this pull request Jun 13, 2025
Rollup of 10 pull requests

Successful merges:

 - #134847 (Implement asymmetrical precedence for closures and jumps)
 - #141491 (Delegate `<CStr as Debug>` to `ByteStr`)
 - #141770 (Merge `Cfg::render_long_html` and `Cfg::render_long_plain` methods common code)
 - #142069 (Introduce `-Zmacro-stats`)
 - #142158 (Tracking the old name of renamed unstable library features)
 - #142221 ([AIX] strip underlying xcoff object)
 - #142340 (miri: we can use apfloat's mul_add now)
 - #142379 (Add bootstrap option to compile a tool with features)
 - #142410 (intrinsics: rename min_align_of to align_of)
 - #142413 (rustc-dev-guide subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit fac011e into rust-lang:master Jun 13, 2025
10 checks passed
@rustbot rustbot added this to the 1.89.0 milestone Jun 13, 2025
rust-timer added a commit that referenced this pull request Jun 13, 2025
Rollup merge of #142158 - xizheyin:141617, r=jdonszelmann

Tracking the old name of renamed unstable library features

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`
@xizheyin xizheyin deleted the 141617 branch June 13, 2025 14:51
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jun 14, 2025
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#134847 (Implement asymmetrical precedence for closures and jumps)
 - rust-lang/rust#141491 (Delegate `<CStr as Debug>` to `ByteStr`)
 - rust-lang/rust#141770 (Merge `Cfg::render_long_html` and `Cfg::render_long_plain` methods common code)
 - rust-lang/rust#142069 (Introduce `-Zmacro-stats`)
 - rust-lang/rust#142158 (Tracking the old name of renamed unstable library features)
 - rust-lang/rust#142221 ([AIX] strip underlying xcoff object)
 - rust-lang/rust#142340 (miri: we can use apfloat's mul_add now)
 - rust-lang/rust#142379 (Add bootstrap option to compile a tool with features)
 - rust-lang/rust#142410 (intrinsics: rename min_align_of to align_of)
 - rust-lang/rust#142413 (rustc-dev-guide subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Jun 16, 2025
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#134847 (Implement asymmetrical precedence for closures and jumps)
 - rust-lang/rust#141491 (Delegate `<CStr as Debug>` to `ByteStr`)
 - rust-lang/rust#141770 (Merge `Cfg::render_long_html` and `Cfg::render_long_plain` methods common code)
 - rust-lang/rust#142069 (Introduce `-Zmacro-stats`)
 - rust-lang/rust#142158 (Tracking the old name of renamed unstable library features)
 - rust-lang/rust#142221 ([AIX] strip underlying xcoff object)
 - rust-lang/rust#142340 (miri: we can use apfloat's mul_add now)
 - rust-lang/rust#142379 (Add bootstrap option to compile a tool with features)
 - rust-lang/rust#142410 (intrinsics: rename min_align_of to align_of)
 - rust-lang/rust#142413 (rustc-dev-guide subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
@workingjubilee
Copy link
Member

workingjubilee commented Jun 18, 2025

diagnosing #142442

@rust-timer build df23987

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (df23987): comparison URL.

Overall result: ❌ regressions - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.2% [0.1%, 0.3%] 10
Regressions ❌
(secondary)
0.2% [0.1%, 0.3%] 21
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 2
All ❌✅ (primary) 0.2% [0.1%, 0.3%] 10

Max RSS (memory usage)

Results (primary -1.3%, secondary -0.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.5% [1.2%, 2.2%] 4
Improvements ✅
(primary)
-1.3% [-1.7%, -0.7%] 3
Improvements ✅
(secondary)
-3.9% [-4.9%, -3.1%] 3
All ❌✅ (primary) -1.3% [-1.7%, -0.7%] 3

Cycles

Results (primary 1.3%, secondary -1.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.3% [1.3%, 1.3%] 1
Regressions ❌
(secondary)
2.6% [2.6%, 2.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.1% [-3.9%, -2.2%] 2
All ❌✅ (primary) 1.3% [1.3%, 1.3%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 754.993s -> 689.634s (-8.66%)
Artifact size: 372.27 MiB -> 372.27 MiB (0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Jun 18, 2025
@xizheyin
Copy link
Contributor Author

This may be in line with expectations?

@Kobzol
Copy link
Contributor

Kobzol commented Jun 18, 2025

Thanks Jubilee (wouldn't guess this one). Yeah, I guess that since this does more work, a small regression on doc benchmarks is fine.

github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Jun 18, 2025
Tracking the old name of renamed unstable library features

This PR resolves the first problem of rust-lang#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`
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Jun 18, 2025
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#134847 (Implement asymmetrical precedence for closures and jumps)
 - rust-lang#141491 (Delegate `<CStr as Debug>` to `ByteStr`)
 - rust-lang#141770 (Merge `Cfg::render_long_html` and `Cfg::render_long_plain` methods common code)
 - rust-lang#142069 (Introduce `-Zmacro-stats`)
 - rust-lang#142158 (Tracking the old name of renamed unstable library features)
 - rust-lang#142221 ([AIX] strip underlying xcoff object)
 - rust-lang#142340 (miri: we can use apfloat's mul_add now)
 - rust-lang#142379 (Add bootstrap option to compile a tool with features)
 - rust-lang#142410 (intrinsics: rename min_align_of to align_of)
 - rust-lang#142413 (rustc-dev-guide subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants