Skip to content

gccrs: add unused braces lint#4625

Open
lucasly-ba wants to merge 1 commit into
Rust-GCC:masterfrom
lucasly-ba:unused-braces
Open

gccrs: add unused braces lint#4625
lucasly-ba wants to merge 1 commit into
Rust-GCC:masterfrom
lucasly-ba:unused-braces

Conversation

@lucasly-ba

Copy link
Copy Markdown
Contributor

This patch adds the unused braces lint, which warns on unnecessary braces around the value of a let binding.

gcc/testsuite/ChangeLog:

* rust/compile/unused-braces_0.rs: New test.

@philberty philberty left a comment

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.

LGTM

@philberty philberty added this pull request to the merge queue Jun 27, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Jun 27, 2026
@lucasly-ba lucasly-ba force-pushed the unused-braces branch 3 times, most recently from a8b1b72 to d3af0b3 Compare June 29, 2026 21:35
Comment thread gcc/rust/checks/lints/unused/rust-unused-checker.cc Outdated
@lucasly-ba lucasly-ba force-pushed the unused-braces branch 2 times, most recently from f64faa6 to c015580 Compare July 8, 2026 22:30
gcc/rust/ChangeLog:

	* checks/lints/unused/rust-unused-checker.cc (UnusedChecker::visit):
	Warn on unnecessary braces around an assigned value.
	* rust-lang.cc (grs_langhook_init_options_struct): Enable warn_unused.

gcc/testsuite/ChangeLog:

	* rust/compile/unused-braces_0.rs: New test.

Signed-off-by: Lucas Ly Ba <lucas.ly-ba@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants