Skip to content

Commit fb6fbf6

Browse files
committed
Rust: Repair after Unimplemented.getLocation was removed.
1 parent ab4788a commit fb6fbf6

File tree

2 files changed

+23
-1707
lines changed

2 files changed

+23
-1707
lines changed

rust/ql/src/queries/diagnostics/MissingElements.ql

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66

77
import rust
88

9+
/**
10+
* Gets a location for an `Unimplemented` node.
11+
*/
12+
Location getUnimplementedLocation(Unimplemented node) {
13+
result = node.(Locatable).getLocation()
14+
or
15+
not node instanceof Locatable and
16+
result instanceof EmptyLocation
17+
}
18+
919
/**
1020
* Gets `l.toString()`, but with any locations outside of the source location prefix cleaned up.
1121
*/
@@ -29,7 +39,7 @@ string multipleString(int i) {
2939
query predicate listUnimplemented(string location, string msg) {
3040
// something that is not extracted yet
3141
exists(int c |
32-
c = strictcount(Unimplemented n | cleanLocationString(n.getLocation()) = location) and
42+
c = strictcount(Unimplemented n | cleanLocationString(getUnimplementedLocation(n)) = location) and
3343
msg = "Not yet implemented" + multipleString(c) + "."
3444
)
3545
}

0 commit comments

Comments
 (0)