Skip to content

Conversation

@lucasly-ba
Copy link
Contributor

This patch is simple, it only moves the check of unused static items and unused const items into the dead-code scan visitor.

@lucasly-ba lucasly-ba force-pushed the dead-code branch 6 times, most recently from fba4e7c to e223a3b Compare November 20, 2025 15:50
This patch is simple, it only moves the check of unused static items
and unused const items into the dead-code scan visitor.

gcc/rust/ChangeLog:

	* checks/lints/rust-lint-scan-deadcode.h: Warns if there is an
	unused static item or unused const item.
	* checks/lints/unused/rust-unused-checker.cc (UnusedChecker::visit):
	Removes static item and const item.
	* checks/lints/unused/rust-unused-checker.h:
	Same here.

gcc/testsuite/ChangeLog:

	* rust/compile/static_item_0.rs: Change warning description.
	* rust/compile/const_item_0.rs: New test.

Signed-off-by: Lucas Ly Ba <lucas.ly-ba@outlook.com>
@@ -1,4 +1,4 @@
// Copyright (C) 2025-2026 Free Software Foundation, Inc.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should keep the original changes

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