Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/expr_store/lower/generics.rs')
-rw-r--r--crates/hir-def/src/expr_store/lower/generics.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/hir-def/src/expr_store/lower/generics.rs b/crates/hir-def/src/expr_store/lower/generics.rs
index 2119f19c06..ce6e73670c 100644
--- a/crates/hir-def/src/expr_store/lower/generics.rs
+++ b/crates/hir-def/src/expr_store/lower/generics.rs
@@ -220,13 +220,10 @@ impl GenericParamsCollector {
);
let predicate = match (target, bound) {
(_, TypeBound::Error | TypeBound::Use(_)) => return,
- (Either::Left(type_ref), bound) => match hrtb_lifetimes {
- Some(hrtb_lifetimes) => WherePredicate::ForLifetime {
- lifetimes: ThinVec::from_iter(hrtb_lifetimes.iter().cloned()),
- target: type_ref,
- bound,
- },
- None => WherePredicate::TypeBound { target: type_ref, bound },
+ (Either::Left(type_ref), bound) => WherePredicate::TypeBound {
+ lifetimes: hrtb_lifetimes.map(|h| ThinVec::from_iter(h.iter().cloned())),
+ target: type_ref,
+ bound,
},
(Either::Right(lifetime), TypeBound::Lifetime(bound)) => {
WherePredicate::Lifetime { target: lifetime, bound }
@@ -257,8 +254,11 @@ impl GenericParamsCollector {
}));
let type_ref = ec.alloc_type_ref(param_id, ptr);
for bound in impl_trait_bounds {
- where_predicates
- .push(WherePredicate::TypeBound { target: type_ref, bound: bound.clone() });
+ where_predicates.push(WherePredicate::TypeBound {
+ lifetimes: None,
+ target: type_ref,
+ bound: bound.clone(),
+ });
}
type_ref
}