Skip to content

Commit 93f8cea

Browse files
committed
Rust: Add + clean up some QLDoc.
1 parent 40f80ff commit 93f8cea

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

rust/ql/lib/codeql/rust/elements/AssignmentOperation.qll

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
/** Provides classes for assignment operations. */
1+
/**
2+
* Provides classes for assignment operations.
3+
*/
24

35
private import rust
46
private import codeql.rust.elements.internal.BinaryExprImpl
57

6-
/** An assignment operation. */
8+
/**
9+
* An assignment operation, for example:
10+
* ```rust
11+
* x = y;
12+
* x += y;
13+
* ```
14+
*/
715
abstract private class AssignmentOperationImpl extends Impl::BinaryExpr { }
816

917
final class AssignmentOperation = AssignmentOperationImpl;
1018

1119
/**
12-
* An assignment expression, for example
13-
*
20+
* An assignment expression, for example:
1421
* ```rust
1522
* x = y;
1623
* ```
@@ -22,8 +29,7 @@ final class AssignmentExpr extends AssignmentOperationImpl {
2229
}
2330

2431
/**
25-
* A compound assignment expression, for example
26-
*
32+
* A compound assignment expression, for example:
2733
* ```rust
2834
* x += y;
2935
* ```

rust/ql/lib/codeql/rust/elements/LogicalOperation.qll

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,48 @@ private import codeql.rust.elements.Expr
22
private import codeql.rust.elements.BinaryExpr
33
private import codeql.rust.elements.PrefixExpr
44

5+
/**
6+
* A logical operation, such as `&&`, `||` or `!`.
7+
*/
58
abstract private class LogicalOperationImpl extends Expr {
69
abstract Expr getAnOperand();
710
}
811

912
final class LogicalOperation = LogicalOperationImpl;
1013

14+
/**
15+
* A binary logical operation, such as `&&` or `||`.
16+
*/
1117
abstract private class BinaryLogicalOperationImpl extends BinaryExpr, LogicalOperationImpl {
1218
override Expr getAnOperand() { result = [this.getLhs(), this.getRhs()] }
1319
}
1420

1521
final class BinaryLogicalOperation = BinaryLogicalOperationImpl;
1622

23+
/**
24+
* The logical and operation, `&&`.
25+
*/
1726
final class LogicalAndExpr extends BinaryLogicalOperationImpl, BinaryExpr {
1827
LogicalAndExpr() { this.getOperatorName() = "&&" }
1928
}
2029

30+
/**
31+
* The logical or operation, `||`.
32+
*/
2133
final class LogicalOrExpr extends BinaryLogicalOperationImpl {
2234
LogicalOrExpr() { this.getOperatorName() = "||" }
2335
}
2436

37+
/**
38+
* A unary logical operation, such as `!`.
39+
*/
2540
abstract private class UnaryLogicalOperationImpl extends PrefixExpr, LogicalOperationImpl { }
2641

2742
final class UnaryLogicalOperation = UnaryLogicalOperationImpl;
2843

44+
/**
45+
* A logical not operation, `!`.
46+
*/
2947
final class LogicalNotExpr extends UnaryLogicalOperationImpl {
3048
LogicalNotExpr() { this.getOperatorName() = "!" }
3149

0 commit comments

Comments
 (0)