Skip to content

Commit 3fad6bd

Browse files
authored
Merge pull request #21495 from hvitved/rust/fix-bad-joins
Rust: Fix two bad joins
2 parents 518d170 + 2ff5c2c commit 3fad6bd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3040,7 +3040,9 @@ private module ConstructionMatchingInput implements MatchingInputSig {
30403040

30413041
override AstNode getNodeAt(AccessPosition apos) {
30423042
result =
3043-
this.getFieldExpr(this.getNthStructField(apos.asPosition()).getName().getText()).getExpr()
3043+
this.getFieldExpr(pragma[only_bind_into](this.getNthStructField(apos.asPosition())
3044+
.getName()
3045+
.getText())).getExpr()
30443046
or
30453047
result = this and apos.isReturn()
30463048
}
@@ -3573,7 +3575,9 @@ private module DeconstructionPatMatchingInput implements MatchingInputSig {
35733575
this =
35743576
any(StructPat sp |
35753577
result =
3576-
sp.getPatField(sp.getNthStructField(apos.asPosition()).getName().getText()).getPat()
3578+
sp.getPatField(pragma[only_bind_into](sp.getNthStructField(apos.asPosition())
3579+
.getName()
3580+
.getText())).getPat()
35773581
)
35783582
or
35793583
result = this.(TupleStructPat).getField(apos.asPosition())

0 commit comments

Comments
 (0)