Skip to content

Conversation

@lucasly-ba
Copy link
Contributor

No description provided.

@dkm
Copy link
Member

dkm commented Jan 13, 2026

Hello! ChangeLog nitpicker here 😅
You should still have the name for the "Likewised" entries:

	* checks/lints/unused/rust-unused-checker.cc (UnusedChecker::visit):
	Add warning.
	* checks/lints/unused/rust-unused-checker.h (UnusedChecker::visit):
	Likewise.
...

Note that for the case above, you're adding the method, so you can simply use:

	* checks/lints/unused/rust-unused-checker.cc (UnusedChecker::visit(HIR::GroupedExpr)):
	New.
	* checks/lints/unused/rust-unused-checker.h (UnusedChecker::visit(HIR::GroupedExpr)):
	New.
...

The other entries can also be cleaned up (i.e. adding the full "path" to the modified thing and maybe using 'New').

Can you fix that small nit? :)

Thanks!

gcc/rust/ChangeLog:

	* checks/lints/unused/rust-unused-checker.cc (UnusedChecker::visit):
	Visit GroupExpr and add unused parens warning if not necessary.
	* checks/lints/unused/rust-unused-checker.h:
	New.
	* checks/lints/unused/rust-unused-collector.cc (UnusedCollector::visit):
	Check if a grouped expr in arithmetical or boolean expr is used.
	* checks/lints/unused/rust-unused-collector.h:
	New.
	* checks/lints/unused/rust-unused-context.cc (UnusedContext::add_group):
	Method helper.
	(UnusedContext::is_group_used):
	Likewise.
	* checks/lints/unused/rust-unused-context.h:
	Likewise.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Lucas Ly Ba <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants