mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
Rust: Query for missing elements.
This commit is contained in:
26
rust/ql/src/queries/diagnostics/MissingElements.ql
Normal file
26
rust/ql/src/queries/diagnostics/MissingElements.ql
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @name Missing Elements
|
||||
* @description List all elements that weren't extracted due to unimplemented features or parse errors.
|
||||
* @kind diagnostic
|
||||
* @id rust/diagnostics/missing-elements
|
||||
*/
|
||||
|
||||
import rust
|
||||
|
||||
query predicate listUnimplemented(AstNode n, string msg) {
|
||||
// not extracted yet
|
||||
n instanceof Unimplemented and
|
||||
msg = "Not yet implemented."
|
||||
}
|
||||
|
||||
query predicate listMissingExpr(Expr e, string msg) {
|
||||
// gaps in the AST due to parse errors
|
||||
e instanceof MissingExpr and
|
||||
msg = "Missing expression."
|
||||
}
|
||||
|
||||
query predicate listMissingPat(Pat p, string msg) {
|
||||
// gaps in the AST due to parse errors
|
||||
p instanceof MissingPat and
|
||||
msg = "Missing pattern."
|
||||
}
|
||||
Reference in New Issue
Block a user