Skip to content

Commit 22b833f

Browse files
committed
Rust: Fix bad join
1 parent 2a207f9 commit 22b833f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,9 @@ private Type inferTryExprType(TryExpr te, TypePath path) {
10441044
)
10451045
}
10461046

1047+
pragma[nomagic]
1048+
private StructType getStrStruct() { result = TStruct(any(Builtins::Str s)) }
1049+
10471050
pragma[nomagic]
10481051
private Type inferLiteralType(LiteralExpr le, TypePath path) {
10491052
path.isEmpty() and
@@ -1074,7 +1077,7 @@ private Type inferLiteralType(LiteralExpr le, TypePath path) {
10741077
path.isEmpty() and result = TRefType()
10751078
or
10761079
path = TypePath::singleton(TRefTypeParameter()) and
1077-
result = TStruct(any(Builtins::Str s))
1080+
result = getStrStruct()
10781081
)
10791082
}
10801083

0 commit comments

Comments
 (0)