mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Rust: Extend methodResolutionDependsOnArgument to parameterized implementations
This commit is contained in:
@@ -1220,9 +1220,17 @@ private Function getTypeParameterMethod(TypeParameter tp, string name) {
|
||||
result = getMethodSuccessor(tp.(ImplTraitTypeTypeParameter).getImplTraitTypeRepr(), name)
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
private Type resolveNonTypeParameterTypeAt(TypeMention tm, TypePath path) {
|
||||
result = tm.resolveTypeAt(path) and
|
||||
not result instanceof TypeParameter
|
||||
}
|
||||
|
||||
bindingset[t1, t2]
|
||||
private predicate typeMentionEqual(TypeMention t1, TypeMention t2) {
|
||||
forex(TypePath path, Type type | t1.resolveTypeAt(path) = type | t2.resolveTypeAt(path) = type)
|
||||
forex(TypePath path, Type type | resolveNonTypeParameterTypeAt(t1, path) = type |
|
||||
resolveNonTypeParameterTypeAt(t2, path) = type
|
||||
)
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
multipleCallTargets
|
||||
| dereference.rs:61:15:61:24 | e1.deref() |
|
||||
| main.rs:2032:13:2032:31 | ...::from(...) |
|
||||
| main.rs:2033:13:2033:31 | ...::from(...) |
|
||||
| main.rs:2034:13:2034:31 | ...::from(...) |
|
||||
| main.rs:2040:13:2040:31 | ...::from(...) |
|
||||
| main.rs:2041:13:2041:31 | ...::from(...) |
|
||||
| main.rs:2042:13:2042:31 | ...::from(...) |
|
||||
| main.rs:2078:21:2078:43 | ...::from(...) |
|
||||
| main.rs:2076:13:2076:31 | ...::from(...) |
|
||||
| main.rs:2077:13:2077:31 | ...::from(...) |
|
||||
| main.rs:2078:13:2078:31 | ...::from(...) |
|
||||
| main.rs:2084:13:2084:31 | ...::from(...) |
|
||||
| main.rs:2085:13:2085:31 | ...::from(...) |
|
||||
| main.rs:2086:13:2086:31 | ...::from(...) |
|
||||
| main.rs:2122:21:2122:43 | ...::from(...) |
|
||||
|
||||
@@ -2028,9 +2028,9 @@ mod method_determined_by_argument_type {
|
||||
x.my_add(&5i64); // $ method=MyAdd<&i64>::my_add
|
||||
x.my_add(true); // $ method=MyAdd<bool>::my_add
|
||||
|
||||
S(1i64).my_add(S(2i64)); // $ method=S::my_add1 $ SPURIOUS method=S::my_add2 $ SPURIOUS method=S::my_add3
|
||||
S(1i64).my_add(3i64); // $ method=S::my_add2 $ SPURIOUS method=S::my_add1 $ SPURIOUS method=S::my_add3
|
||||
S(1i64).my_add(&3i64); // $ method=S::my_add3 $ SPURIOUS method=S::my_add1 $ SPURIOUS method=S::my_add2
|
||||
S(1i64).my_add(S(2i64)); // $ method=S::my_add1
|
||||
S(1i64).my_add(3i64); // $ MISSING: method=S::my_add2
|
||||
S(1i64).my_add(&3i64); // $ method=S::my_add3
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user