Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rust/ql/lib/codeql/rust/internal/PathResolution.qll
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,7 @@ private predicate useImportEdge(Use use, string name, ItemNode item) {
*/
private predicate preludeEdge(SourceFile f, string name, ItemNode i) {
exists(Crate core, ModuleLikeNode mod, ModuleItemNode prelude, ModuleItemNode rust |
f = any(Crate c0 | core = c0.getDependency(_)).getASourceFile() and
f = any(Crate c0 | core = c0.getDependency(_) or core = c0).getASourceFile() and
Copy link

Copilot AI May 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The combined dependency check core = c0.getDependency(_) or core = c0 can be hard to read; consider adding parentheses around the OR expression or splitting it into two predicates for clarity.

Suggested change
f = any(Crate c0 | core = c0.getDependency(_) or core = c0).getASourceFile() and
f = any(Crate c0 | (core = c0.getDependency(_) or core = c0)).getASourceFile() and

Copilot uses AI. Check for mistakes.
core.getName() = "core" and
mod = core.getSourceFile() and
prelude = mod.getASuccessorRec("prelude") and
Expand All @@ -1438,8 +1438,8 @@ private module Debug {
private Locatable getRelevantLocatable() {
exists(string filepath, int startline, int startcolumn, int endline, int endcolumn |
result.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) and
filepath.matches("%/term.rs") and
startline = [71]
filepath.matches("%/test.rs") and
startline = 74
)
}

Expand Down