Commit 4da5fdc
committed
gccrs: refactor dead code lint
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 <[email protected]>1 parent 85f2a83 commit 4da5fdc
File tree
5 files changed
+31
-27
lines changed- gcc
- rust/checks/lints
- unused
- testsuite/rust/compile
5 files changed
+31
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
136 | 163 | | |
137 | 164 | | |
138 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | 40 | | |
64 | 41 | | |
65 | 42 | | |
66 | 43 | | |
67 | 44 | | |
68 | 45 | | |
| 46 | + | |
69 | 47 | | |
70 | 48 | | |
71 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | | - | |
| 2 | + | |
0 commit comments