Skip to content

Commit

Permalink
Rust: Repair after Unimplemented.getLocation was removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffw0 committed Sep 16, 2024
1 parent ab4788a commit fb6fbf6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1,707 deletions.
12 changes: 11 additions & 1 deletion rust/ql/src/queries/diagnostics/MissingElements.ql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@

import rust

/**
* Gets a location for an `Unimplemented` node.
*/
Location getUnimplementedLocation(Unimplemented node) {
result = node.(Locatable).getLocation()
or
not node instanceof Locatable and
result instanceof EmptyLocation
}

/**
* Gets `l.toString()`, but with any locations outside of the source location prefix cleaned up.
*/
Expand All @@ -29,7 +39,7 @@ string multipleString(int i) {
query predicate listUnimplemented(string location, string msg) {
// something that is not extracted yet
exists(int c |
c = strictcount(Unimplemented n | cleanLocationString(n.getLocation()) = location) and
c = strictcount(Unimplemented n | cleanLocationString(getUnimplementedLocation(n)) = location) and
msg = "Not yet implemented" + multipleString(c) + "."
)
}
Expand Down
Loading

0 comments on commit fb6fbf6

Please sign in to comment.