File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
rust/ql/lib/codeql/rust/internal Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ private import codeql.rust.elements.internal.generated.Synth
9
9
10
10
cached
11
11
newtype TType =
12
+ TUnit ( ) or
12
13
TStruct ( Struct s ) { Stages:: TypeInferenceStage:: ref ( ) } or
13
14
TEnum ( Enum e ) or
14
15
TTrait ( Trait t ) or
@@ -48,6 +49,21 @@ abstract class Type extends TType {
48
49
abstract Location getLocation ( ) ;
49
50
}
50
51
52
+ /** The unit type `()`. */
53
+ class UnitType extends Type , TUnit {
54
+ UnitType ( ) { this = TUnit ( ) }
55
+
56
+ override StructField getStructField ( string name ) { none ( ) }
57
+
58
+ override TupleField getTupleField ( int i ) { none ( ) }
59
+
60
+ override TypeParameter getTypeParameter ( int i ) { none ( ) }
61
+
62
+ override string toString ( ) { result = "()" }
63
+
64
+ override Location getLocation ( ) { result instanceof EmptyLocation }
65
+ }
66
+
51
67
abstract private class StructOrEnumType extends Type {
52
68
abstract ItemNode asItemNode ( ) ;
53
69
}
You can’t perform that action at this time.
0 commit comments