Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 2 additions & 6 deletions rust/ql/lib/codeql/rust/internal/PathResolution.qll
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ abstract class ItemNode extends Locatable {
Stages::PathResolutionStage::ref() and
result = this.getASuccessorRec(name)
or
preludeEdge(this, name, result) and not declares(this, _, name)
preludeEdge(this, name, result)
or
this instanceof SourceFile and
builtin(name, result)
Expand Down Expand Up @@ -1505,12 +1505,8 @@ private predicate externCrateEdge(ExternCrateItemNode ec, string name, CrateItem
*/
pragma[nomagic]
private predicate preludeEdge(SourceFile f, string name, ItemNode i) {
not declares(f, _, name) and
exists(Crate stdOrCore, ModuleLikeNode mod, ModuleItemNode prelude, ModuleItemNode rust |
f = any(Crate c0 | stdOrCore = c0.getDependency(_) or stdOrCore = c0).getASourceFile()
or
// Give builtin files access to the prelude
f instanceof BuiltinSourceFile
|
stdOrCore.getName() = ["std", "core"] and
mod = stdOrCore.getSourceFile() and
prelude = mod.getASuccessorRec("prelude") and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
multipleCallTargets
| main.rs:85:19:85:40 | ...::from(...) |
| main.rs:102:19:102:40 | ...::from(...) |
| main.rs:374:5:374:27 | ... .add_assign(...) |
| main.rs:459:9:459:23 | z.add_assign(...) |