Skip to content

Skip linting unused braces for FunctionArg and MethodArg context for 2024 later #154373

Open
chenyukang wants to merge 1 commit intorust-lang:mainfrom
chenyukang:yukang-fix-154247-unused-braces-temp-scope-lite
Open

Skip linting unused braces for FunctionArg and MethodArg context for 2024 later #154373
chenyukang wants to merge 1 commit intorust-lang:mainfrom
chenyukang:yukang-fix-154247-unused-braces-temp-scope-lite

Conversation

@chenyukang
Copy link
Member

@chenyukang chenyukang commented Mar 25, 2026

Fixes #154247

unused_braces is a AST level lint, but in Rust 2024 braces around function and method arguments can affect temporary drop scope.

I tried to find a more complete fix for it, but seems all too heavy, which involve AST visitor or need hir related stuff.

Instead of teaching this lint to reason about semantics, so it's better to stop linting those argument-position braces in 2024 later edition.

@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 Mar 25, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 25, 2026

r? @fmease

rustbot has assigned @fmease.
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

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

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unused_braces warning emitted for braces that have semantic value

3 participants