Update rust/ql/lib/codeql/rust/internal/TypeInference.qll

Co-authored-by: Simon Friis Vindum <paldepind@github.com>
This commit is contained in:
Geoffrey White
2025-06-23 13:04:56 +01:00
committed by GitHub
parent 34cd9766d5
commit d02a7288ff

View File

@@ -1152,10 +1152,9 @@ private Type inferForLoopExprType(AstNode n, TypePath path) {
or
iterablePath.isCons(any(ArrayTypeParameter tp), path)
or
exists(TypePath path0 |
iterablePath.isCons(any(RefTypeParameter tp), path0) and
path0.isCons(any(SliceTypeParameter tp), path)
)
iterablePath
.stripPrefix(TypePath::cons(TRefTypeParameter(),
TypePath::singleton(any(SliceTypeParameter tp)))) = path
// TODO: iterables (general case for containers, ranges etc)
)
)