Skip to content

Commit 1236e2b

Browse files
committed
Rust: Add references to alternatives in the getStmtOrExpr methods.
1 parent 4570d7e commit 1236e2b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rust/ql/lib/codeql/rust/elements/internal/StmtListImpl.qll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ module Impl {
2929
class StmtList extends Generated::StmtList {
3030
/**
3131
* Gets the `index`th statement or expression of this statement list (0-based).
32+
*
33+
* This includes both the statements and any tail expression in the statement list. To access
34+
* just the statements, use `getStatement`. To access just the tail expression, if any,
35+
* use `getTailExpr`.
3236
*/
3337
AstNode getStmtOrExpr(int index) {
3438
result = this.getStatement(index)
@@ -39,6 +43,10 @@ module Impl {
3943

4044
/**
4145
* Gets any of the statements or expressions of this statement list.
46+
*
47+
* This includes both the statements and any tail expression in the statement list. To access
48+
* just the statements, use `getAStatement`. To access just the tail expression, if any,
49+
* use `getTailExpr`.
4250
*/
4351
final AstNode getAStmtOrExpr() { result = this.getStmtOrExpr(_) }
4452

0 commit comments

Comments
 (0)