From fa7f9d696f5863dbf28b3d0ef14c1bc9143b2d21 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 13 Jan 2019 11:58:41 +0100 Subject: Make Module impl methods crate-private, update some comments --- crates/ra_hir/src/ty.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir/src/ty.rs') diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index b9a48929d..8e93a4457 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs @@ -242,7 +242,8 @@ pub enum Ty { // Opaque(DefId, Substs), /// A type parameter; for example, `T` in `fn f(x: T) {} Param { - /// The index of the parameter. + /// The index of the parameter (starting with parameters from the + /// surrounding impl, then the current function). idx: u32, /// The name of the parameter, for displaying. name: Name, @@ -440,7 +441,9 @@ impl Ty { if (idx as usize) < substs.0.len() { substs.0[idx as usize].clone() } else { - // TODO it's yet unclear to me whether we need to shift the indices here + // 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 } } } -- cgit v1.2.3