Rust: Add variable capture consistency query

This commit is contained in:
Simon Friis Vindum
2024-12-12 11:23:22 +01:00
parent 9fe7bb3e2b
commit 16dcc5c278
3 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
/**
* @name Variable capture data flow inconsistencies
* @description Lists the variable capture data flow inconsistencies in the database. This query is intended for internal use.
* @kind table
* @id rust/diagnostics/variable-capture-data-flow-consistency
*/
import codeql.rust.dataflow.internal.DataFlowImpl::VariableCapture::Flow::ConsistencyChecks

View File

@@ -0,0 +1,5 @@
variableAccessAstNesting
| test.rs:396:26:396:26 | b | test.rs:409:28:414:9 | { ... } | CapturedVariable access is not nested in the defining callable |
| test.rs:409:23:409:25 | foo | test.rs:409:28:414:9 | { ... } | CapturedVariable access is not nested in the defining callable |
consistencyOverview
| CapturedVariable access is not nested in the defining callable | 2 |

View File

@@ -0,0 +1,4 @@
variableAccessAstNesting
| variables.rs:436:13:436:13 | i | variables.rs:437:17:439:5 | { ... } | CapturedVariable access is not nested in the defining callable |
consistencyOverview
| CapturedVariable access is not nested in the defining callable | 1 |