Skip to content

Commit fa1c92d

Browse files
committed
Rust: Another case worth having.
1 parent 7a6eabc commit fa1c92d

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

rust/ql/test/query-tests/unusedentities/UnusedVariable.expected

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
| main.rs:268:9:268:11 | Yes | Variable is not used. |
1717
| main.rs:269:9:269:10 | No | Variable is not used. |
1818
| main.rs:272:12:272:12 | j | Variable is not used. |
19-
| main.rs:290:25:290:25 | y | Variable is not used. |
20-
| main.rs:294:28:294:28 | a | Variable is not used. |
21-
| main.rs:298:9:298:9 | p | Variable is not used. |
22-
| main.rs:305:13:305:13 | y | Variable is not used. |
23-
| main.rs:313:21:313:21 | y | Variable is not used. |
19+
| main.rs:282:12:282:14 | Yes | Variable is not used. |
20+
| main.rs:294:25:294:25 | y | Variable is not used. |
21+
| main.rs:298:28:298:28 | a | Variable is not used. |
22+
| main.rs:302:9:302:9 | p | Variable is not used. |
23+
| main.rs:309:13:309:13 | y | Variable is not used. |
24+
| main.rs:317:21:317:21 | y | Variable is not used. |

rust/ql/test/query-tests/unusedentities/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ fn if_lets_matches() {
278278
}
279279
}
280280

281+
let l = Yes;
282+
if let Yes = l { // SPURIOUS: unused variable 'Yes'
283+
}
284+
281285
match 1 {
282286
1 => {}
283287
_ => {}

0 commit comments

Comments
 (0)