Skip to content

rustc_feature: Separate "renamed" features from "removed" features#155129

Open
nik-rev wants to merge 2 commits intorust-lang:mainfrom
nik-contrib:renamed-features
Open

rustc_feature: Separate "renamed" features from "removed" features#155129
nik-rev wants to merge 2 commits intorust-lang:mainfrom
nik-contrib:renamed-features

Conversation

@nik-rev
Copy link
Copy Markdown
Contributor

@nik-rev nik-rev commented Apr 10, 2026

There are quite a few "renamed" features that are grouped in the same category as "removed".

So I've split them up into a separate renamed.rs file, and added a new category for "Renamed" features.

This has the following advantages:

  • We now have a new error specifically for "renamed" features, which suggests replacing the old feature name with the new feature name, which means we can (probably) feel less bad about renaming them
  • The tidy script is updated to check that the new feature names actually exist.
  • My next PR: When renaming a feature, we don't just instantly break nightly users - we can have a grace period (e.g., 3 versions) where the old name is still recognized, but a warning is emitted

@rustbot rustbot added A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 10, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 10, 2026

r? @jdonszelmann

rustbot has assigned @jdonszelmann.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 11 candidates

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@Kivooeo Kivooeo self-assigned this Apr 11, 2026
@nik-rev nik-rev force-pushed the renamed-features branch 2 times, most recently from abdc8a8 to 0c0cf8f Compare April 11, 2026 11:47
Copy link
Copy Markdown
Member

@Kivooeo Kivooeo left a comment

Choose a reason for hiding this comment

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

overall i'm very much in favor of this change

View changes since this review

Comment thread compiler/rustc_expand/src/config.rs Outdated
code = "{new_name}",
applicability = "machine-applicable"
)]
#[label("feature was renamed")]
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Contributor Author

@nik-rev nik-rev Apr 18, 2026

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:

- error[E0557]: feature has been removed
+ error[E0557]: feature was renamed
    --> $DIR/feature-gate-sanitize.rs:1:12
     |
  LL | #![feature(no_sanitize)]
-    |            ^^^^^^^^^^^ feature has been removed
+    |            ^^^^^^^^^^^
+    |            |
+    |            feature was renamed
+    |            help: update to the new name: `sanitize`

Copy link
Copy Markdown
Member

@Kivooeo Kivooeo Apr 18, 2026

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(this review not for this test specific, but i need to put it somewhere, so just random file)

we need to add a //@ run-rustfix test, to check that machine-applicable fix works when applied

/// 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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should it be a doc comment?

Co-authored-by: Kivooeo <75776246+Kivooeo@users.noreply.github.com>
@Kivooeo
Copy link
Copy Markdown
Member

Kivooeo commented Apr 21, 2026

@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 Apr 21, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 21, 2026

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tidy Area: The tidy tool S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants