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
99
1010cached
1111newtype TType =
12+ TUnit ( ) or
1213 TStruct ( Struct s ) { Stages:: TypeInferenceStage:: ref ( ) } or
1314 TEnum ( Enum e ) or
1415 TTrait ( Trait t ) or
@@ -48,6 +49,21 @@ abstract class Type extends TType {
4849 abstract Location getLocation ( ) ;
4950}
5051
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+
5167abstract private class StructOrEnumType extends Type {
5268 abstract ItemNode asItemNode ( ) ;
5369}
You can’t perform that action at this time.
0 commit comments