aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-07-14 19:19:38 +0000
committerGitHub <noreply@github.com>2021-07-14 19:19:38 +0000
commit51f66ab1368fcd69ea1289bafae8f5eadda932dd (patch)
tree33b0371f7dfda2bde560da676c3887eb9c71bc2d
parentb4ea3a19464b9bc79dad9cf5bb9bffc660718632 (diff)
parente25ef1ec868ad3904ca3774be7d3ef256e434945 (diff)
downloadgcc-51f66ab1368fcd69ea1289bafae8f5eadda932dd.zip
gcc-51f66ab1368fcd69ea1289bafae8f5eadda932dd.tar.gz
gcc-51f66ab1368fcd69ea1289bafae8f5eadda932dd.tar.bz2
Merge #564
564: Add some comments about what's kind of unused item will be warned r=philberty a=thomasyonug Add some comments about what's kind of unused item will be warned Co-authored-by: Thomas Young <wenzhang5800@gmail.com>
-rw-r--r--gcc/rust/lint/rust-lint-scan-deadcode.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/rust/lint/rust-lint-scan-deadcode.h b/gcc/rust/lint/rust-lint-scan-deadcode.h
index 1128818..6cf6281 100644
--- a/gcc/rust/lint/rust-lint-scan-deadcode.h
+++ b/gcc/rust/lint/rust-lint-scan-deadcode.h
@@ -29,6 +29,13 @@
namespace Rust {
namespace Analysis {
+// Scan item symbols and warn the symbol if it is not in the live_symbols set.
+// There are three kinds of item we should handle in this pass.
+// 1. Function item
+// 2. TODO: The function item in the impl block without trait
+// 3. StructStruct, e.g., `Struct Foo{one: 1, two: 2}`. Furthermore, the unused
+// struct fields will be warned too.
+// 4. TupleStruct, e.g., `Struct Foo(i32, i32)`
class ScanDeadcode : public MarkLiveBase
{
using Rust::Analysis::MarkLiveBase::visit;