aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty/src')
-rw-r--r--crates/ra_hir_ty/src/lower.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/crates/ra_hir_ty/src/lower.rs b/crates/ra_hir_ty/src/lower.rs
index 25c894c95..459b96280 100644
--- a/crates/ra_hir_ty/src/lower.rs
+++ b/crates/ra_hir_ty/src/lower.rs
@@ -140,10 +140,13 @@ impl Ty {
140 ImplTraitLoweringMode::Variable => { 140 ImplTraitLoweringMode::Variable => {
141 let idx = ctx.impl_trait_counter.get(); 141 let idx = ctx.impl_trait_counter.get();
142 ctx.impl_trait_counter.set(idx + 1); 142 ctx.impl_trait_counter.set(idx + 1);
143 let generics = 143 let (self_params, list_params, _impl_trait_params) = if let Some(def) = ctx.resolver.generic_def() {
144 generics(ctx.db, ctx.resolver.generic_def().expect("generics in scope")); 144 let generics = generics(ctx.db, def);
145 let (self_params, list_params, impl_trait_params) = generics.provenance_split(); 145 generics.provenance_split()
146 assert!((idx as usize) < impl_trait_params); 146 } else {
147 (0, 0, 0)
148 };
149 // assert!((idx as usize) < impl_trait_params); // TODO return position impl trait
147 Ty::Bound(idx as u32 + self_params as u32 + list_params as u32) 150 Ty::Bound(idx as u32 + self_params as u32 + list_params as u32)
148 } 151 }
149 ImplTraitLoweringMode::Disallowed => { 152 ImplTraitLoweringMode::Disallowed => {