Skip to content

Commit d02a728

Browse files
geoffw0paldepind
andauthored
Update rust/ql/lib/codeql/rust/internal/TypeInference.qll
Co-authored-by: Simon Friis Vindum <[email protected]>
1 parent 34cd976 commit d02a728

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,10 +1152,9 @@ private Type inferForLoopExprType(AstNode n, TypePath path) {
11521152
or
11531153
iterablePath.isCons(any(ArrayTypeParameter tp), path)
11541154
or
1155-
exists(TypePath path0 |
1156-
iterablePath.isCons(any(RefTypeParameter tp), path0) and
1157-
path0.isCons(any(SliceTypeParameter tp), path)
1158-
)
1155+
iterablePath
1156+
.stripPrefix(TypePath::cons(TRefTypeParameter(),
1157+
TypePath::singleton(any(SliceTypeParameter tp)))) = path
11591158
// TODO: iterables (general case for containers, ranges etc)
11601159
)
11611160
)

0 commit comments

Comments
 (0)