Skip to content

Commit d20bc98

Browse files
committed
Rust: fix missing canonical paths
1 parent 5b7485d commit d20bc98

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ class CrateItemNode extends ItemNode instanceof Crate {
380380
file = super.getSourceFile()
381381
)
382382
or
383+
c = this and
383384
this.getName() = "core" and
384385
child instanceof Builtins::BuiltinType
385386
}

rust/ql/test/extractor-tests/canonical_path/canonical_paths.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ canonicalPath
2929
| regular.rs:69:1:71:1 | fn is_number_or_letter | test::regular::is_number_or_letter |
3030
| regular.rs:73:1:75:1 | trait Abs | test::regular::Abs |
3131
| regular.rs:74:5:74:25 | fn abs | <_ as test::regular::Abs>::abs |
32+
| regular.rs:77:1:85:1 | impl Abs for i32 { ... } | <core::i32 as test::regular::Abs> |
33+
| regular.rs:78:5:84:5 | fn abs | <core::i32 as test::regular::Abs>::abs |
3234
canonicalPaths
3335
| anonymous.rs:1:1:1:26 | use ...::Trait | None | None |
3436
| anonymous.rs:3:1:32:1 | fn canonicals | repo::test | crate::anonymous::canonicals |

0 commit comments

Comments
 (0)