Skip to content

Commit 714423d

Browse files
committed
Rust: Adjust jump-to-def for paths with generic arguments
1 parent 0cd8c90 commit 714423d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

rust/ql/lib/codeql/rust/internal/Definitions.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ private class PositionalFormatArgumentUse extends Use instanceof PositionalForma
135135
override string getUseType() { result = "format argument" }
136136
}
137137

138-
private class PathUse extends Use instanceof PathSegment {
138+
private class PathUse extends Use instanceof NameRef {
139139
private Path path;
140140

141-
PathUse() { this = path.getSegment() }
141+
PathUse() { this = path.getSegment().getIdentifier() }
142142

143143
private CallExpr getCall() { result.getFunction().(PathExpr).getPath() = path }
144144

rust/ql/test/library-tests/definitions/Definitions.expected

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
| main.rs:10:36:10:39 | Self | main.rs:7:9:7:21 | struct S | path |
44
| main.rs:11:17:11:17 | S | main.rs:7:9:7:21 | struct S | path |
55
| main.rs:16:22:16:22 | T | main.rs:16:19:16:19 | T | path |
6-
| main.rs:18:13:18:17 | S2::<...> | main.rs:16:5:16:24 | struct S2 | path |
6+
| main.rs:18:13:18:14 | S2 | main.rs:16:5:16:24 | struct S2 | path |
77
| main.rs:18:16:18:16 | T | main.rs:18:10:18:10 | T | path |
88
| main.rs:19:23:19:23 | T | main.rs:18:10:18:10 | T | path |
99
| main.rs:19:29:19:32 | Self | main.rs:16:5:16:24 | struct S2 | path |
@@ -34,7 +34,7 @@
3434
| main.rs:38:5:38:5 | s | main.rs:37:9:37:9 | s | local variable |
3535
| main.rs:38:7:38:12 | method | main.rs:10:13:12:13 | fn method | method |
3636
| main.rs:39:5:39:6 | M1 | main.rs:5:1:23:1 | mod M1 | path |
37-
| main.rs:39:9:39:15 | S2::<...> | main.rs:16:5:16:24 | struct S2 | path |
37+
| main.rs:39:9:39:10 | S2 | main.rs:16:5:16:24 | struct S2 | path |
3838
| main.rs:39:14:39:14 | S | main.rs:1:1:1:9 | struct S | path |
3939
| main.rs:39:18:39:20 | new | main.rs:19:9:21:9 | fn new | path |
4040
| main.rs:39:22:39:22 | S | main.rs:1:1:1:9 | struct S | path |

0 commit comments

Comments
 (0)