File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
rust/ql/lib/codeql/rust/internal Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,13 @@ module Consistency {
226
226
227
227
predicate nonUniqueCertainType ( AstNode n , TypePath path , Type t ) {
228
228
strictcount ( CertainTypeInference:: inferCertainType ( n , path ) ) > 1 and
229
- t = CertainTypeInference:: inferCertainType ( n , path )
229
+ 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
+ )
230
236
}
231
237
}
232
238
You can’t perform that action at this time.
0 commit comments