mirror of
https://github.com/github/codeql.git
synced 2026-04-08 00:24:03 +02:00
Rust: Repair after Unimplemented.getLocation was removed.
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
@@ -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) + "."
|
||||
)
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user