Skip to content

Commit 78b9d8f

Browse files
authored
Merge pull request #19580 from hvitved/rust/path-resolution-prelude-in-core
Rust: Also include prelude path resolution in Core
2 parents 5df50c0 + ba77264 commit 78b9d8f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,7 @@ private predicate useImportEdge(Use use, string name, ItemNode item) {
14131413
*/
14141414
private predicate preludeEdge(SourceFile f, string name, ItemNode i) {
14151415
exists(Crate core, ModuleLikeNode mod, ModuleItemNode prelude, ModuleItemNode rust |
1416-
f = any(Crate c0 | core = c0.getDependency(_)).getASourceFile() and
1416+
f = any(Crate c0 | core = c0.getDependency(_) or core = c0).getASourceFile() and
14171417
core.getName() = "core" and
14181418
mod = core.getSourceFile() and
14191419
prelude = mod.getASuccessorRec("prelude") and
@@ -1438,8 +1438,8 @@ private module Debug {
14381438
private Locatable getRelevantLocatable() {
14391439
exists(string filepath, int startline, int startcolumn, int endline, int endcolumn |
14401440
result.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) and
1441-
filepath.matches("%/term.rs") and
1442-
startline = [71]
1441+
filepath.matches("%/test.rs") and
1442+
startline = 74
14431443
)
14441444
}
14451445

0 commit comments

Comments
 (0)