Skip to content

Commit addfd3a

Browse files
committed
wip2
1 parent a828a8f commit addfd3a

File tree

4 files changed

+304
-179
lines changed

4 files changed

+304
-179
lines changed

rust/ql/lib/codeql/rust/elements/internal/ImplImpl.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,11 @@ module Impl {
3333
result = "impl " + trait + this.getSelfTy().toAbbreviatedString() + " { ... }"
3434
)
3535
}
36+
37+
/**
38+
* Holds if this is an inherent `impl` block, that is, one that does not implement a trait.
39+
*/
40+
pragma[nomagic]
41+
predicate isInherent() { not this.hasTrait() }
3642
}
3743
}

rust/ql/lib/codeql/rust/internal/typeinference/FunctionType.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class AssocFunctionType extends MkAssocFunctionType {
211211
}
212212

213213
pragma[nomagic]
214-
private Trait getALookupTrait(Type t) {
214+
Trait getALookupTrait(Type t) {
215215
result = t.(TypeParamTypeParameter).getTypeParam().(TypeParamItemNode).resolveABound()
216216
or
217217
result = t.(SelfTypeParameter).getTrait()

0 commit comments

Comments
 (0)