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
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 24, 2026
Remove redundant `#[rustc_paren_sugar]` feature gate

It is already gated on `rustc_attrs`.

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

r? @JonathanBrouwer
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 24, 2026
Remove redundant `#[rustc_paren_sugar]` feature gate

It is already gated on `rustc_attrs`.

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

r? @JonathanBrouwer
rust-bors Bot pushed a commit that referenced this pull request Jul 24, 2026
Rollup of 17 pull requests

Successful merges:

 - #158168 (Added implementation on `set_permissions_nofollow` for all primary platforms)
 - #138618 (Support using const pointers in asm `const` operand)
 - #157962 (Function item should not be used as const arg)
 - #158404 (trait_solver: normalize next-gen region constraints)
 - #158709 (rustdoc: warn on improperly interleaved HTML/MD)
 - #159720 (document #[global_allocator] constraints)
 - #159732 (optimization: don't look for diagnostic/canonical items without rustc_attrs enabled)
 - #159740 (reuse regular exported_non_generic_symbols logic in Miri)
 - #159780 (check `extern "custom"` function pointers)
 - #159786 (rustdoc-js: ignore editor temp files in test folder discovery)
 - #159819 (std::sync::poison: disable auto_cfg on PoisonError::new)
 - #155388 (stepping into where-clauses during normalization may be productive)
 - #155914 (when bailing on ambiguity, don't force other results to ambig)
 - #159411 ([rustdoc] Correctly handle output options with --show-coverage)
 - #159439 (Fix(lib/fs/win): Fall back on Win32 delete for `Dir::remove_file`)
 - #159809 (Avoid `#[target_features]`)
 - #159826 (Remove redundant `#[rustc_paren_sugar]` feature gate)
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 25, 2026
Remove redundant `#[rustc_paren_sugar]` feature gate

It is already gated on `rustc_attrs`.

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

r? @JonathanBrouwer
rust-bors Bot pushed a commit that referenced this pull request Jul 25, 2026
Rollup of 16 pull requests

Successful merges:

 - #138618 (Support using const pointers in asm `const` operand)
 - #157962 (Function item should not be used as const arg)
 - #158404 (trait_solver: normalize next-gen region constraints)
 - #158709 (rustdoc: warn on improperly interleaved HTML/MD)
 - #159720 (document #[global_allocator] constraints)
 - #159732 (optimization: don't look for diagnostic/canonical items without rustc_attrs enabled)
 - #159740 (reuse regular exported_non_generic_symbols logic in Miri)
 - #159780 (check `extern "custom"` function pointers)
 - #159786 (rustdoc-js: ignore editor temp files in test folder discovery)
 - #159819 (std::sync::poison: disable auto_cfg on PoisonError::new)
 - #155388 (stepping into where-clauses during normalization may be productive)
 - #155914 (when bailing on ambiguity, don't force other results to ambig)
 - #159411 ([rustdoc] Correctly handle output options with --show-coverage)
 - #159439 (Fix(lib/fs/win): Fall back on Win32 delete for `Dir::remove_file`)
 - #159809 (Avoid `#[target_features]`)
 - #159826 (Remove redundant `#[rustc_paren_sugar]` feature gate)
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 25, 2026
Remove redundant `#[rustc_paren_sugar]` feature gate

It is already gated on `rustc_attrs`.

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

r? @JonathanBrouwer
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 25, 2026
Remove redundant `#[rustc_paren_sugar]` feature gate

It is already gated on `rustc_attrs`.

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

r? @JonathanBrouwer
rust-bors Bot pushed a commit that referenced this pull request Jul 25, 2026
Rollup of 20 pull requests

Successful merges:

 - #138618 (Support using const pointers in asm `const` operand)
 - #157962 (Lower paths to functions in const args as ConstKind::Error)
 - #158404 (trait_solver: normalize next-gen region constraints)
 - #158709 (rustdoc: warn on improperly interleaved HTML/MD)
 - #159720 (document #[global_allocator] constraints)
 - #159732 (optimization: don't look for diagnostic/canonical items without rustc_attrs enabled)
 - #159738 (implement `CovariantUnsafeCell`)
 - #159740 (reuse regular exported_non_generic_symbols logic in Miri)
 - #159780 (check `extern "custom"` function pointers)
 - #159786 (rustdoc-js: ignore editor temp files in test folder discovery)
 - #159819 (std::sync::poison: disable auto_cfg on PoisonError::new)
 - #155388 (stepping into where-clauses during normalization may be productive)
 - #155914 (when bailing on ambiguity, don't force other results to ambig)
 - #159439 (Fix(lib/fs/win): Fall back on Win32 delete for `Dir::remove_file`)
 - #159676 (Update wasm-component-ld to 0.5.27)
 - #159730 (allow accessing the contents of UnsafeCell without going through get)
 - #159809 (Avoid `#[target_features]`)
 - #159826 (Remove redundant `#[rustc_paren_sugar]` feature gate)
 - #159853 (Updated expect messages for `CString` struct and method documentation)
 - #159877 (Revert "Export `derive` at `core::derive` and `std::derive`")
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