Skip to content

Commit 3f1f37f

Browse files
committed
Address review comments
1 parent 3142dbb commit 3f1f37f

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

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

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,7 @@ abstract private class ModuleLikeNode extends ItemNode {
212212
private class SourceFileItemNode extends ModuleLikeNode, SourceFile {
213213
pragma[nomagic]
214214
ModuleLikeNode getSuper() {
215-
exists(ModuleItemNode mod |
216-
fileImport(mod, this) and
217-
result = mod.getASuccessor("super")
218-
)
215+
result = any(ModuleItemNode mod | fileImport(mod, this)).getASuccessor("super")
219216
}
220217

221218
override string getName() { result = "(source file)" }
@@ -858,11 +855,10 @@ private ItemNode resolvePathPrivate(
858855
/**
859856
* Gets a module that has access to private items defined inside `itemParent`.
860857
*
861-
* According to
862-
*
863-
* https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/book/second-edition/ch07-02-controlling-visibility-with-pub.html#privacy-rules
858+
* According to [The Rust Reference][1] this is either `itemParent` itself or any
859+
* descendant of `itemParent`.
864860
*
865-
* this is either `itemParent` itself or any (transitive) child of `itemParent`.
861+
* [1]: https://doc.rust-lang.org/reference/visibility-and-privacy.html#r-vis.access
866862
*/
867863
pragma[nomagic]
868864
private ModuleLikeNode getAPrivateVisibleModule(ModuleLikeNode itemParent) {
@@ -964,10 +960,6 @@ private module Debug {
964960
private Locatable getRelevantLocatable() {
965961
exists(string filepath, int startline, int startcolumn, int endline, int endcolumn |
966962
result.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) and
967-
// filepath.matches("%/compile.rs") and
968-
// startline = 1986
969-
// filepath.matches("%/build_steps/mod.rs") and
970-
// startline = 17
971963
filepath.matches("%/main.rs") and
972964
startline = 1
973965
)

0 commit comments

Comments
 (0)