@@ -47,6 +47,8 @@ newtype TType =
47
47
TImplTraitType ( ImplTraitTypeRepr impl ) or
48
48
TDynTraitType ( Trait t ) { t = any ( DynTraitTypeRepr dt ) .getTrait ( ) } or
49
49
TSliceType ( ) or
50
+ TNeverType ( ) or
51
+ TPtrType ( ) or
50
52
TTupleTypeParameter ( int arity , int i ) { exists ( TTuple ( arity ) ) and i in [ 0 .. arity - 1 ] } or
51
53
TTypeParamTypeParameter ( TypeParam t ) or
52
54
TAssociatedTypeTypeParameter ( TypeAlias t ) { any ( TraitItemNode trait ) .getAnAssocItem ( ) = t } or
@@ -57,7 +59,8 @@ newtype TType =
57
59
} or
58
60
TRefTypeParameter ( ) or
59
61
TSelfTypeParameter ( Trait t ) or
60
- TSliceTypeParameter ( )
62
+ TSliceTypeParameter ( ) or
63
+ TPtrTypeParameter ( )
61
64
62
65
private predicate implTraitTypeParam ( ImplTraitTypeRepr implTrait , int i , TypeParam tp ) {
63
66
implTrait .isInReturnPos ( ) and
@@ -374,6 +377,33 @@ class SliceType extends Type, TSliceType {
374
377
override Location getLocation ( ) { result instanceof EmptyLocation }
375
378
}
376
379
380
+ class NeverType extends Type , TNeverType {
381
+ override StructField getStructField ( string name ) { none ( ) }
382
+
383
+ override TupleField getTupleField ( int i ) { none ( ) }
384
+
385
+ override TypeParameter getPositionalTypeParameter ( int i ) { none ( ) }
386
+
387
+ override string toString ( ) { result = "!" }
388
+
389
+ override Location getLocation ( ) { result instanceof EmptyLocation }
390
+ }
391
+
392
+ class PtrType extends Type , TPtrType {
393
+ override StructField getStructField ( string name ) { none ( ) }
394
+
395
+ override TupleField getTupleField ( int i ) { none ( ) }
396
+
397
+ override TypeParameter getPositionalTypeParameter ( int i ) {
398
+ i = 0 and
399
+ result = TPtrTypeParameter ( )
400
+ }
401
+
402
+ override string toString ( ) { result = "*" }
403
+
404
+ override Location getLocation ( ) { result instanceof EmptyLocation }
405
+ }
406
+
377
407
/** A type parameter. */
378
408
abstract class TypeParameter extends Type {
379
409
override StructField getStructField ( string name ) { none ( ) }
@@ -529,6 +559,12 @@ class SliceTypeParameter extends TypeParameter, TSliceTypeParameter {
529
559
override Location getLocation ( ) { result instanceof EmptyLocation }
530
560
}
531
561
562
+ class PtrTypeParameter extends TypeParameter , TPtrTypeParameter {
563
+ override string toString ( ) { result = "*T" }
564
+
565
+ override Location getLocation ( ) { result instanceof EmptyLocation }
566
+ }
567
+
532
568
/**
533
569
* The implicit `Self` type parameter of a trait, that refers to the
534
570
* implementing type of the trait.
0 commit comments