From db9a5a9ac047ed13aebd136edaabd4309f442e99 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Thu, 21 Feb 2019 21:25:27 +0100 Subject: Add an assert (and fix the other) --- crates/ra_hir/src/ty.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates') diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index 7f28a6edd..1a3e1994f 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs @@ -443,7 +443,7 @@ impl Ty { for _ in supplied_params..def_generics.count_params_including_parent() { substs.push(Ty::Unknown); } - assert_eq!(substs.len(), def_generics.params.len()); + assert_eq!(substs.len(), def_generics.count_params_including_parent()); Substs(substs.into()) } @@ -1374,6 +1374,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { for _ in supplied_params..parent_param_count + param_count { substs.push(Ty::Unknown); } + assert_eq!(substs.len(), parent_param_count + param_count); Substs(substs.into()) } -- cgit v1.2.3