File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
lib/codeql/rust/elements/internal
test/library-tests/operations Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
7
7
private import codeql.rust.elements.internal.generated.RefExpr
8
+ private import codeql.rust.elements.internal.OperationImpl:: Impl as OperationImpl
8
9
9
10
/**
10
11
* INTERNAL: This module contains the customizable definition of `RefExpr` and should not
@@ -21,11 +22,15 @@ module Impl {
21
22
* let raw_mut: &mut i32 = &raw mut foo;
22
23
* ```
23
24
*/
24
- class RefExpr extends Generated:: RefExpr {
25
+ class RefExpr extends Generated:: RefExpr , OperationImpl :: Operation {
25
26
override string toStringImpl ( ) {
26
27
result = "&" + concat ( int i | | this .getSpecPart ( i ) , " " order by i )
27
28
}
28
29
30
+ override string getOperatorName ( ) { result = "&" }
31
+
32
+ override Expr getAnOperand ( ) { result = this .getExpr ( ) }
33
+
29
34
private string getSpecPart ( int index ) {
30
35
index = 0 and this .isRaw ( ) and result = "raw"
31
36
or
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ fn test_operations(
50
50
51
51
// miscellaneous expressions that might be operations
52
52
* ptr; // $ Operation Op=* Operands=1 PrefixExpr DerefExpr
53
- & x; // $ RefExpr
53
+ & x; // $ Operation Op=& Operands=1 RefExpr MISSING: PrefixExpr
54
54
res?;
55
55
56
56
return Ok ( ( ) ) ;
You can’t perform that action at this time.
0 commit comments