We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de8e535 commit e610465Copy full SHA for e610465
1 file changed
rust/ql/lib/codeql/rust/internal/TypeInference.qll
@@ -226,7 +226,13 @@ module Consistency {
226
227
predicate nonUniqueCertainType(AstNode n, TypePath path, Type t) {
228
strictcount(CertainTypeInference::inferCertainType(n, path)) > 1 and
229
- t = CertainTypeInference::inferCertainType(n, path)
+ t = CertainTypeInference::inferCertainType(n, path) and
230
+ // Suppress the inconsistency if `n` is a self parameter and the type
231
+ // mention for the self type has multiple types for a path.
232
+ not exists(ImplItemNode impl, TypePath path0 |
233
+ n = impl.getAnAssocItem().(Function).getParamList().getSelfParam() and
234
+ strictcount(impl.(Impl).getSelfTy().(TypeMention).resolveTypeAt(path0)) > 1
235
+ )
236
}
237
238
0 commit comments