diff options
Diffstat (limited to 'crates/ra_hir/src/ty.rs')
-rw-r--r-- | crates/ra_hir/src/ty.rs | 60 |
1 files changed, 22 insertions, 38 deletions
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index 7905d86a1..e1edf1bff 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs | |||
@@ -35,32 +35,22 @@ pub enum Ty { | |||
35 | /// A primitive floating-point type. For example, `f64`. | 35 | /// A primitive floating-point type. For example, `f64`. |
36 | Float(primitive::FloatTy), | 36 | Float(primitive::FloatTy), |
37 | 37 | ||
38 | /// Structures, enumerations and unions. | 38 | // Structures, enumerations and unions. |
39 | /// | 39 | // Adt(AdtDef, Substs), |
40 | /// Substs here, possibly against intuition, *may* contain `Param`s. | ||
41 | /// That is, even after substitution it is possible that there are type | ||
42 | /// variables. This happens when the `Adt` corresponds to an ADT | ||
43 | /// definition and not a concrete use of it. | ||
44 | // Adt(&'tcx AdtDef, &'tcx Substs<'tcx>), | ||
45 | |||
46 | // Foreign(DefId), | ||
47 | |||
48 | /// The pointee of a string slice. Written as `str`. | 40 | /// The pointee of a string slice. Written as `str`. |
49 | Str, | 41 | Str, |
50 | 42 | ||
51 | /// An array with the given length. Written as `[T; n]`. | 43 | // An array with the given length. Written as `[T; n]`. |
52 | // Array(Ty<'tcx>, &'tcx ty::Const<'tcx>), | 44 | // Array(Ty, ty::Const), |
53 | |||
54 | /// The pointee of an array slice. Written as `[T]`. | 45 | /// The pointee of an array slice. Written as `[T]`. |
55 | Slice(TyRef), | 46 | Slice(TyRef), |
56 | 47 | ||
57 | /// A raw pointer. Written as `*mut T` or `*const T` | 48 | // A raw pointer. Written as `*mut T` or `*const T` |
58 | // RawPtr(TypeAndMut<'tcx>), | 49 | // RawPtr(TypeAndMut<'tcx>), |
59 | 50 | ||
60 | /// A reference; a pointer with an associated lifetime. Written as | 51 | // A reference; a pointer with an associated lifetime. Written as |
61 | /// `&'a mut T` or `&'a T`. | 52 | // `&'a mut T` or `&'a T`. |
62 | // Ref(Region<'tcx>, Ty<'tcx>, hir::Mutability), | 53 | // Ref(Ty<'tcx>, hir::Mutability), |
63 | |||
64 | /// A pointer to a function. Written as `fn() -> i32`. | 54 | /// A pointer to a function. Written as `fn() -> i32`. |
65 | /// | 55 | /// |
66 | /// For example the type of `bar` here: | 56 | /// For example the type of `bar` here: |
@@ -71,9 +61,8 @@ pub enum Ty { | |||
71 | /// ``` | 61 | /// ``` |
72 | FnPtr(Arc<FnSig>), | 62 | FnPtr(Arc<FnSig>), |
73 | 63 | ||
74 | /// A trait, defined with `trait`. | 64 | // A trait, defined with `dyn trait`. |
75 | // Dynamic(Binder<&'tcx List<ExistentialPredicate<'tcx>>>, ty::Region<'tcx>), | 65 | // Dynamic(), |
76 | |||
77 | /// The anonymous type of a closure. Used to represent the type of | 66 | /// The anonymous type of a closure. Used to represent the type of |
78 | /// `|a| a`. | 67 | /// `|a| a`. |
79 | // Closure(DefId, ClosureSubsts<'tcx>), | 68 | // Closure(DefId, ClosureSubsts<'tcx>), |
@@ -92,30 +81,25 @@ pub enum Ty { | |||
92 | /// A tuple type. For example, `(i32, bool)`. | 81 | /// A tuple type. For example, `(i32, bool)`. |
93 | Tuple(Vec<Ty>), | 82 | Tuple(Vec<Ty>), |
94 | 83 | ||
95 | /// The projection of an associated type. For example, | 84 | // The projection of an associated type. For example, |
96 | /// `<T as Trait<..>>::N`. | 85 | // `<T as Trait<..>>::N`. |
97 | // Projection(ProjectionTy<'tcx>), | 86 | // Projection(ProjectionTy), |
98 | 87 | ||
99 | /// Opaque (`impl Trait`) type found in a return type. | 88 | // Opaque (`impl Trait`) type found in a return type. |
100 | /// The `DefId` comes either from | 89 | // The `DefId` comes either from |
101 | /// * the `impl Trait` ast::Ty node, | 90 | // * the `impl Trait` ast::Ty node, |
102 | /// * or the `existential type` declaration | 91 | // * or the `existential type` declaration |
103 | /// The substitutions are for the generics of the function in question. | 92 | // The substitutions are for the generics of the function in question. |
104 | /// After typeck, the concrete type can be found in the `types` map. | 93 | // Opaque(DefId, Substs), |
105 | // Opaque(DefId, &'tcx Substs<'tcx>), | ||
106 | 94 | ||
107 | /// A type parameter; for example, `T` in `fn f<T>(x: T) {} | 95 | // A type parameter; for example, `T` in `fn f<T>(x: T) {} |
108 | // Param(ParamTy), | 96 | // Param(ParamTy), |
109 | 97 | ||
110 | /// Bound type variable, used only when preparing a trait query. | 98 | // A placeholder type - universally quantified higher-ranked type. |
111 | // Bound(ty::DebruijnIndex, BoundTy), | ||
112 | |||
113 | /// A placeholder type - universally quantified higher-ranked type. | ||
114 | // Placeholder(ty::PlaceholderType), | 99 | // Placeholder(ty::PlaceholderType), |
115 | 100 | ||
116 | /// A type variable used during type checking. | 101 | // A type variable used during type checking. |
117 | // Infer(InferTy), | 102 | // Infer(InferTy), |
118 | |||
119 | /// A placeholder for a type which could not be computed; this is | 103 | /// A placeholder for a type which could not be computed; this is |
120 | /// propagated to avoid useless error messages. | 104 | /// propagated to avoid useless error messages. |
121 | Unknown, | 105 | Unknown, |