diff --git a/rust/ql/lib/codeql/rust/internal/PathResolution.qll b/rust/ql/lib/codeql/rust/internal/PathResolution.qll index 2128bb8e7a82..169e3c365b07 100644 --- a/rust/ql/lib/codeql/rust/internal/PathResolution.qll +++ b/rust/ql/lib/codeql/rust/internal/PathResolution.qll @@ -187,7 +187,12 @@ abstract class ItemNode extends Locatable { this = result.(ImplOrTraitItemNode).getAnItemInSelfScope() or name = "crate" and - this = result.(CrateItemNode).getASourceFile() + result = + any(CrateItemNode crate | + this = crate.getASourceFile() + or + this = crate.getModuleNode() + ) } /** Gets the location of this item. */