Skip to content

Commit bad9262

Browse files
committed
Rust: create locations for Format and FormatArgument
1 parent 017d492 commit bad9262

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

rust/ql/lib/codeql/rust/elements/internal/LocationImpl.qll

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
private import codeql.files.FileSystem
2+
private import codeql.rust.elements.Locatable
3+
private import codeql.rust.elements.Format
4+
private import codeql.rust.elements.FormatArgument
25

36
module LocationImpl {
47
newtype TLocation =
58
TLocationDefault(@location_default location) or
69
TLocationSynth(File file, int beginLine, int beginColumn, int endLine, int endColumn) {
7-
not locations_default(_, file, beginLine, beginColumn, endLine, endColumn) and none()
10+
not locations_default(_, file, beginLine, beginColumn, endLine, endColumn) and
11+
exists(string filePath | file.getAbsolutePath() = filePath |
12+
any(Format f).hasLocationInfo(filePath, beginLine, beginColumn, endLine, endColumn) or
13+
any(FormatArgument f).hasLocationInfo(filePath, beginLine, beginColumn, endLine, endColumn)
14+
)
815
}
916

1017
/**

0 commit comments

Comments
 (0)