about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-03-02 13:55:08 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-03-02 13:55:08 +0000
commit30b87eb88073e48b8cde416ca7ff4eb59e408e20 (patch)
tree4f700cec98628d0ea1a1ad704b3d4050ce71680c
parent592b906604d60a86af74c5dbb3bf40b2ddcf8061 (diff)
parent862b663501570d24deefd72e76dfd4ff35d88e61 (diff)
downloadrust-30b87eb88073e48b8cde416ca7ff4eb59e408e20.tar.gz
rust-30b87eb88073e48b8cde416ca7ff4eb59e408e20.zip
Merge #914
914: A bit of cleanup in ty.rs r=flodiebold a=flodiebold



Co-authored-by: Florian Diebold <flodiebold@gmail.com>
-rw-r--r--crates/ra_hir/src/ty.rs29
1 files changed, 1 insertions, 28 deletions
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs
index e505c86e387..78270a9b7cd 100644
--- a/crates/ra_hir/src/ty.rs
+++ b/crates/ra_hir/src/ty.rs
@@ -54,7 +54,7 @@ pub enum Ty {
     /// The pointee of an array slice.  Written as `[T]`.
     Slice(Arc<Ty>),
 
-    // An array with the given length. Written as `[T; n]`.
+    /// An array with the given length. Written as `[T; n]`.
     Array(Arc<Ty>),
 
     /// A raw pointer. Written as `*mut T` or `*const T`
@@ -97,36 +97,12 @@ pub enum Ty {
     /// ```
     FnPtr(Arc<FnSig>),
 
-    // rustc has a separate type for each function, which just coerces to the
-    // above function pointer type. Once we implement generics, we will probably
-    // need this as well.
-
-    // A trait, defined with `dyn Trait`.
-    // Dynamic(),
-
-    // The anonymous type of a closure. Used to represent the type of
-    // `|a| a`.
-    // Closure(DefId, ClosureSubsts<'tcx>),
-
-    // The anonymous type of a generator. Used to represent the type of
-    // `|a| yield a`.
-    // Generator(DefId, GeneratorSubsts<'tcx>, hir::GeneratorMovability),
-
-    // A type representing the types stored inside a generator.
-    // This should only appear in GeneratorInteriors.
-    // GeneratorWitness(Binder<&'tcx List<Ty<'tcx>>>),
     /// The never type `!`.
     Never,
 
     /// A tuple type.  For example, `(i32, bool)`.
     Tuple(Arc<[Ty]>),
 
-    // The projection of an associated type.  For example,
-    // `<T as Trait<..>>::N`.pub
-    // Projection(ProjectionTy),
-
-    // Opaque (`impl Trait`) type found in a return type.
-    // Opaque(DefId, Substs),
     /// A type parameter; for example, `T` in `fn f<T>(x: T) {}
     Param {
         /// The index of the parameter (starting with parameters from the
@@ -304,9 +280,6 @@ impl Ty {
                 if (idx as usize) < substs.0.len() {
                     substs.0[idx as usize].clone()
                 } else {
-                    // TODO: does this indicate a bug? i.e. should we always
-                    // have substs for all type params? (they might contain the
-                    // params themselves again...)
                     Ty::Param { idx, name }
                 }
             }