Skip to content

Commit

Permalink
Rust: Another case worth having.
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffw0 committed Oct 9, 2024
1 parent 7a6eabc commit fa1c92d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 6 additions & 5 deletions rust/ql/test/query-tests/unusedentities/UnusedVariable.expected
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
| main.rs:268:9:268:11 | Yes | Variable is not used. |
| main.rs:269:9:269:10 | No | Variable is not used. |
| main.rs:272:12:272:12 | j | Variable is not used. |
| main.rs:290:25:290:25 | y | Variable is not used. |
| main.rs:294:28:294:28 | a | Variable is not used. |
| main.rs:298:9:298:9 | p | Variable is not used. |
| main.rs:305:13:305:13 | y | Variable is not used. |
| main.rs:313:21:313:21 | y | Variable is not used. |
| main.rs:282:12:282:14 | Yes | Variable is not used. |
| main.rs:294:25:294:25 | y | Variable is not used. |
| main.rs:298:28:298:28 | a | Variable is not used. |
| main.rs:302:9:302:9 | p | Variable is not used. |
| main.rs:309:13:309:13 | y | Variable is not used. |
| main.rs:317:21:317:21 | y | Variable is not used. |
4 changes: 4 additions & 0 deletions rust/ql/test/query-tests/unusedentities/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ fn if_lets_matches() {
}
}

let l = Yes;
if let Yes = l { // SPURIOUS: unused variable 'Yes'
}

match 1 {
1 => {}
_ => {}
Expand Down

0 comments on commit fa1c92d

Please sign in to comment.