From 86348f5994cdc3831edf3a5582d6d9d576fd1d80 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 2 Feb 2020 13:43:04 +0100 Subject: Comment fixes / todos --- crates/ra_hir_ty/src/infer/expr.rs | 1 + crates/ra_hir_ty/src/lib.rs | 2 ++ crates/ra_hir_ty/src/lower.rs | 11 +++++------ 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'crates/ra_hir_ty/src') diff --git a/crates/ra_hir_ty/src/infer/expr.rs b/crates/ra_hir_ty/src/infer/expr.rs index 8b8378499..b32df8e90 100644 --- a/crates/ra_hir_ty/src/infer/expr.rs +++ b/crates/ra_hir_ty/src/infer/expr.rs @@ -587,6 +587,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { self.write_method_resolution(tgt_expr, func); (ty, self.db.value_ty(func.into()), Some(generics(self.db, func.into()))) } + // TODO fix this None => (receiver_ty, Binders::new(0, Ty::Unknown), None), }; let substs = self.substs_for_method_call(def_generics, generic_args, &derefed_receiver_ty); diff --git a/crates/ra_hir_ty/src/lib.rs b/crates/ra_hir_ty/src/lib.rs index 6eccd7fa8..1da4bcc19 100644 --- a/crates/ra_hir_ty/src/lib.rs +++ b/crates/ra_hir_ty/src/lib.rs @@ -288,10 +288,12 @@ pub enum Ty { Projection(ProjectionTy), /// A type parameter; for example, `T` in `fn f(x: T) {} + // TODO fix documentation Param(TypeParamId), /// A bound type variable. Used during trait resolution to represent Chalk /// variables, and in `Dyn` and `Opaque` bounds to represent the `Self` type. + // TODO fix documentation Bound(u32), /// A type variable used during type checking. Not to be confused with a diff --git a/crates/ra_hir_ty/src/lower.rs b/crates/ra_hir_ty/src/lower.rs index e375c4847..76e2fbabf 100644 --- a/crates/ra_hir_ty/src/lower.rs +++ b/crates/ra_hir_ty/src/lower.rs @@ -37,10 +37,9 @@ pub struct TyLoweringContext<'a, DB: HirDatabase> { pub db: &'a DB, pub resolver: &'a Resolver, /// Note: Conceptually, it's thinkable that we could be in a location where - /// some type params are quantified universally (and should be represented - /// as placeholders), and others are quantified existentially (and should be - /// converted to variables). I think in practice, this isn't possible - /// currently, so this should be fine for now. + /// some type params should be represented as placeholders, and others + /// should be converted to variables. I think in practice, this isn't + /// possible currently, so this should be fine for now. pub type_param_mode: TypeParamLoweringMode, pub impl_trait_mode: ImplTraitLoweringMode, pub impl_trait_counter: std::cell::Cell, @@ -71,8 +70,8 @@ pub enum ImplTraitLoweringMode { /// types of functions we're calling. Opaque, /// `impl Trait` gets lowered into a type variable. Used for argument - /// position impl Trait currently, since it allows us to support that - /// without Chalk. + /// position impl Trait when inside the respective function, since it allows + /// us to support that without Chalk. Param, /// `impl Trait` gets lowered into a variable that can unify with some /// type. This is used in places where values flow 'in', i.e. for arguments -- cgit v1.2.3