diff options
author | Thomas Young <wenzhang5800@gmail.com> | 2021-07-14 14:08:37 +0800 |
---|---|---|
committer | Thomas Young <wenzhang5800@gmail.com> | 2021-07-14 14:08:37 +0800 |
commit | e25ef1ec868ad3904ca3774be7d3ef256e434945 (patch) | |
tree | 33b0371f7dfda2bde560da676c3887eb9c71bc2d | |
parent | b4ea3a19464b9bc79dad9cf5bb9bffc660718632 (diff) | |
download | gcc-e25ef1ec868ad3904ca3774be7d3ef256e434945.zip gcc-e25ef1ec868ad3904ca3774be7d3ef256e434945.tar.gz gcc-e25ef1ec868ad3904ca3774be7d3ef256e434945.tar.bz2 |
Add some comments about wha's kind of unused item will be warned
-rw-r--r-- | gcc/rust/lint/rust-lint-scan-deadcode.h | 7 |
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; |