Skip to content

Conversation

@lucasly-ba
Copy link
Contributor

No description provided.

gcc/rust/ChangeLog:

	* checks/lints/unused/rust-unused-checker.cc (UnusedChecker::visit_loop_label):
	Add warning for unused label in LoopLabel expr.
	* checks/lints/unused/rust-unused-checker.h: Likewise.
	* checks/lints/unused/rust-unused-collector.cc (UnusedCollector::visit):
	Check in BreakExpr and ContinueExpr if a label is used.
	* checks/lints/unused/rust-unused-collector.h: Likewise.
	* checks/lints/unused/rust-unused-context.cc (UnusedContext::add_label):
	Method helper.
	(UnusedContext::is_label_used): Likewise
	* checks/lints/unused/rust-unused-context.h: Likewise.

gcc/testsuite/ChangeLog:

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

Signed-off-by: Lucas Ly Ba <[email protected]>
@P-E-P P-E-P added this pull request to the merge queue Jan 7, 2026
Merged via the queue into Rust-GCC:master with commit 8e0858d Jan 7, 2026
12 checks passed
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