Skip to content

Commit fec31a6

Browse files
committed
Rust: Include variable name in Unused{Variable,Value}.ql
1 parent 2b37c6c commit fec31a6

File tree

4 files changed

+47
-47
lines changed

4 files changed

+47
-47
lines changed

rust/ql/src/queries/unusedentities/UnusedValue.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ where
2121
// avoid overlap with the unused variable query
2222
not isUnused(v) and
2323
not v instanceof DiscardVariable
24-
select write, "Variable is assigned a value that is never used."
24+
select write, "Variable '" + v + "' is assigned a value that is never used."

rust/ql/src/queries/unusedentities/UnusedVariable.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ import UnusedVariable
1313

1414
from Variable v
1515
where isUnused(v)
16-
select v, "Variable is not used."
16+
select v, "Variable '" + v + "' is not used."
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
| main.rs:6:9:6:9 | a | Variable is assigned a value that is never used. |
2-
| main.rs:9:9:9:9 | d | Variable is assigned a value that is never used. |
3-
| main.rs:35:5:35:5 | b | Variable is assigned a value that is never used. |
4-
| main.rs:37:5:37:5 | c | Variable is assigned a value that is never used. |
5-
| main.rs:40:5:40:5 | c | Variable is assigned a value that is never used. |
6-
| main.rs:44:9:44:9 | d | Variable is assigned a value that is never used. |
7-
| main.rs:50:5:50:5 | e | Variable is assigned a value that is never used. |
8-
| main.rs:61:5:61:5 | f | Variable is assigned a value that is never used. |
9-
| main.rs:63:5:63:5 | f | Variable is assigned a value that is never used. |
10-
| main.rs:65:5:65:5 | g | Variable is assigned a value that is never used. |
11-
| main.rs:87:9:87:9 | a | Variable is assigned a value that is never used. |
12-
| main.rs:108:9:108:10 | is | Variable is assigned a value that is never used. |
13-
| main.rs:131:13:131:17 | total | Variable is assigned a value that is never used. |
14-
| main.rs:194:13:194:31 | res | Variable is assigned a value that is never used. |
15-
| main.rs:206:9:206:24 | kind | Variable is assigned a value that is never used. |
16-
| main.rs:210:9:210:32 | kind | Variable is assigned a value that is never used. |
17-
| main.rs:266:13:266:17 | total | Variable is assigned a value that is never used. |
18-
| main.rs:334:5:334:39 | kind | Variable is assigned a value that is never used. |
19-
| main.rs:359:9:359:9 | x | Variable is assigned a value that is never used. |
20-
| main.rs:367:17:367:17 | x | Variable is assigned a value that is never used. |
21-
| more.rs:24:9:24:11 | val | Variable is assigned a value that is never used. |
22-
| more.rs:44:9:44:14 | a_ptr4 | Variable is assigned a value that is never used. |
23-
| more.rs:59:9:59:13 | d_ptr | Variable is assigned a value that is never used. |
24-
| more.rs:65:9:65:17 | f_ptr | Variable is assigned a value that is never used. |
1+
| main.rs:6:9:6:9 | a | Variable 'a' is assigned a value that is never used. |
2+
| main.rs:9:9:9:9 | d | Variable 'd' is assigned a value that is never used. |
3+
| main.rs:35:5:35:5 | b | Variable 'b' is assigned a value that is never used. |
4+
| main.rs:37:5:37:5 | c | Variable 'c' is assigned a value that is never used. |
5+
| main.rs:40:5:40:5 | c | Variable 'c' is assigned a value that is never used. |
6+
| main.rs:44:9:44:9 | d | Variable 'd' is assigned a value that is never used. |
7+
| main.rs:50:5:50:5 | e | Variable 'e' is assigned a value that is never used. |
8+
| main.rs:61:5:61:5 | f | Variable 'f' is assigned a value that is never used. |
9+
| main.rs:63:5:63:5 | f | Variable 'f' is assigned a value that is never used. |
10+
| main.rs:65:5:65:5 | g | Variable 'g' is assigned a value that is never used. |
11+
| main.rs:87:9:87:9 | a | Variable 'a' is assigned a value that is never used. |
12+
| main.rs:108:9:108:10 | is | Variable 'is' is assigned a value that is never used. |
13+
| main.rs:131:13:131:17 | total | Variable 'total' is assigned a value that is never used. |
14+
| main.rs:194:13:194:31 | res | Variable 'res' is assigned a value that is never used. |
15+
| main.rs:206:9:206:24 | kind | Variable 'kind' is assigned a value that is never used. |
16+
| main.rs:210:9:210:32 | kind | Variable 'kind' is assigned a value that is never used. |
17+
| main.rs:266:13:266:17 | total | Variable 'total' is assigned a value that is never used. |
18+
| main.rs:334:5:334:39 | kind | Variable 'kind' is assigned a value that is never used. |
19+
| main.rs:359:9:359:9 | x | Variable 'x' is assigned a value that is never used. |
20+
| main.rs:367:17:367:17 | x | Variable 'x' is assigned a value that is never used. |
21+
| more.rs:24:9:24:11 | val | Variable 'val' is assigned a value that is never used. |
22+
| more.rs:44:9:44:14 | a_ptr4 | Variable 'a_ptr4' is assigned a value that is never used. |
23+
| more.rs:59:9:59:13 | d_ptr | Variable 'd_ptr' is assigned a value that is never used. |
24+
| more.rs:65:9:65:17 | f_ptr | Variable 'f_ptr' is assigned a value that is never used. |
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
| main.rs:25:9:25:9 | a | Variable is not used. |
2-
| main.rs:90:13:90:13 | d | Variable is not used. |
3-
| main.rs:139:5:139:5 | y | Variable is not used. |
4-
| main.rs:166:9:166:9 | x | Variable is not used. |
5-
| main.rs:236:17:236:17 | a | Variable is not used. |
6-
| main.rs:244:20:244:22 | val | Variable is not used. |
7-
| main.rs:258:14:258:16 | val | Variable is not used. |
8-
| main.rs:273:22:273:24 | val | Variable is not used. |
9-
| main.rs:280:24:280:26 | val | Variable is not used. |
10-
| main.rs:288:13:288:15 | num | Variable is not used. |
11-
| main.rs:303:12:303:12 | j | Variable is not used. |
12-
| main.rs:323:25:323:25 | y | Variable is not used. |
13-
| main.rs:326:28:326:28 | a | Variable is not used. |
14-
| main.rs:329:9:329:9 | p | Variable is not used. |
15-
| main.rs:347:9:347:13 | right | Variable is not used. |
16-
| main.rs:353:9:353:14 | right2 | Variable is not used. |
17-
| main.rs:360:13:360:13 | y | Variable is not used. |
18-
| main.rs:368:21:368:21 | y | Variable is not used. |
19-
| main.rs:413:26:413:28 | val | Variable is not used. |
20-
| main.rs:416:21:416:23 | acc | Variable is not used. |
21-
| main.rs:437:9:437:14 | unused | Variable is not used. |
1+
| main.rs:25:9:25:9 | a | Variable 'a' is not used. |
2+
| main.rs:90:13:90:13 | d | Variable 'd' is not used. |
3+
| main.rs:139:5:139:5 | y | Variable 'y' is not used. |
4+
| main.rs:166:9:166:9 | x | Variable 'x' is not used. |
5+
| main.rs:236:17:236:17 | a | Variable 'a' is not used. |
6+
| main.rs:244:20:244:22 | val | Variable 'val' is not used. |
7+
| main.rs:258:14:258:16 | val | Variable 'val' is not used. |
8+
| main.rs:273:22:273:24 | val | Variable 'val' is not used. |
9+
| main.rs:280:24:280:26 | val | Variable 'val' is not used. |
10+
| main.rs:288:13:288:15 | num | Variable 'num' is not used. |
11+
| main.rs:303:12:303:12 | j | Variable 'j' is not used. |
12+
| main.rs:323:25:323:25 | y | Variable 'y' is not used. |
13+
| main.rs:326:28:326:28 | a | Variable 'a' is not used. |
14+
| main.rs:329:9:329:9 | p | Variable 'p' is not used. |
15+
| main.rs:347:9:347:13 | right | Variable 'right' is not used. |
16+
| main.rs:353:9:353:14 | right2 | Variable 'right2' is not used. |
17+
| main.rs:360:13:360:13 | y | Variable 'y' is not used. |
18+
| main.rs:368:21:368:21 | y | Variable 'y' is not used. |
19+
| main.rs:413:26:413:28 | val | Variable 'val' is not used. |
20+
| main.rs:416:21:416:23 | acc | Variable 'acc' is not used. |
21+
| main.rs:437:9:437:14 | unused | Variable 'unused' is not used. |

0 commit comments

Comments
 (0)