Skip to content

Remove redundant #[rustc_paren_sugar] feature gate#159826

Open
mejrs wants to merge 1 commit into
rust-lang:mainfrom
mejrs:sugar_parens
Open

Remove redundant #[rustc_paren_sugar] feature gate#159826
mejrs wants to merge 1 commit into
rust-lang:mainfrom
mejrs:sugar_parens

Conversation

@mejrs

@mejrs mejrs commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

It is already gated on rustc_attrs.

Alternatively we could update attribute parsing to optionally require multiple features, but that seems unnecessary.

r? @JonathanBrouwer

@rustbot rustbot added 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. labels Jul 24, 2026
@rustbot

rustbot commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

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

@JonathanBrouwer JonathanBrouwer Jul 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You seem to have found a mistake in #157195

Before that PR, this attribute was only gated behind unboxed_closures.
I think it's best to return to that state, since it being gated behind two feature gates is weird

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I feel somewhat uncomfortable about a rustc_ attribute not being gated behind rustc_attrs 🤔, do we have any others that are like that? I think it's an important convention to have.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's quite a few of them actually, just a random few examples

  • rustc_intrinsic is gated behind intrinsics
  • rustc_eii_foreign_item is gated behind eii_internals
  • rustc_allowed_through_unstable_modules is gated behind staged_api
  • rustc_default_body_unstable is gated behind staged_api
  • rustc_align is gated behind fn_align (tho this one is intended to stabilize)

This is what I could quickly find, there's a few more of them.

If we do choose rustc_attrs, is the unboxed_closures still useful as a feature then?

@mejrs mejrs Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hmm not really, it just defuses this error:

    /// When the code is using the `Fn` traits directly, instead of the `Fn(A) -> B` syntax, emit
    /// an error and attempt to build a reasonable structured suggestion.

looks like everything related is behind fn_traits

@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 Jul 24, 2026
@rustbot

rustbot commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

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

@rustbot

rustbot commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

@rustbot rustbot added the A-attributes Area: Attributes (`#[…]`, `#![…]`) label Jul 24, 2026
@mejrs

mejrs commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

Gate changed to unboxed_closures.

@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 Jul 24, 2026

@JonathanBrouwer JonathanBrouwer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@rust-bors

rust-bors Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 4bd52e9 has been approved by JonathanBrouwer

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 1. This pull request will be tested once the tree is reopened.

Reason for tree closure: spurious CI failures

@rust-bors rust-bors Bot 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 Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants