mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Rust: Use hasImplementation in path resolution
This commit is contained in:
@@ -425,14 +425,7 @@ abstract private class AssocItemNode extends ItemNode, AssocItem {
|
||||
private class ConstItemNode extends AssocItemNode instanceof Const {
|
||||
override string getName() { result = Const.super.getName().getText() }
|
||||
|
||||
override predicate hasImplementation() {
|
||||
super.hasBody()
|
||||
or
|
||||
// for trait items from library code, we do not currently know if they
|
||||
// have default implementations or not, so we assume they do
|
||||
not this.fromSource() and
|
||||
this = any(TraitItemNode t).getAnAssocItem()
|
||||
}
|
||||
override predicate hasImplementation() { Const.super.hasImplementation() }
|
||||
|
||||
override Namespace getNamespace() { result.isValue() }
|
||||
|
||||
@@ -508,14 +501,7 @@ private class VariantItemNode extends ItemNode instanceof Variant {
|
||||
class FunctionItemNode extends AssocItemNode instanceof Function {
|
||||
override string getName() { result = Function.super.getName().getText() }
|
||||
|
||||
override predicate hasImplementation() {
|
||||
super.hasBody()
|
||||
or
|
||||
// for trait items from library code, we do not currently know if they
|
||||
// have default implementations or not, so we assume they do
|
||||
not this.fromSource() and
|
||||
this = any(TraitItemNode t).getAnAssocItem()
|
||||
}
|
||||
override predicate hasImplementation() { Function.super.hasImplementation() }
|
||||
|
||||
override Namespace getNamespace() { result.isValue() }
|
||||
|
||||
|
||||
@@ -21,5 +21,3 @@ multiplePathResolutions
|
||||
| deallocation.rs:261:11:261:22 | ...::from | file://:0:0:0:0 | fn from |
|
||||
| deallocation.rs:261:11:261:22 | ...::from | file://:0:0:0:0 | fn from |
|
||||
| deallocation.rs:261:11:261:22 | ...::from | file://:0:0:0:0 | fn from |
|
||||
| lifetime.rs:415:32:415:49 | ...::clone | file://:0:0:0:0 | fn clone |
|
||||
| lifetime.rs:415:32:415:49 | ...::clone | file://:0:0:0:0 | fn clone |
|
||||
|
||||
Reference in New Issue
Block a user