Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/expr_store/pretty.rs')
-rw-r--r--crates/hir-def/src/expr_store/pretty.rs25
1 files changed, 11 insertions, 14 deletions
diff --git a/crates/hir-def/src/expr_store/pretty.rs b/crates/hir-def/src/expr_store/pretty.rs
index bc16a9e979..67eb0814c7 100644
--- a/crates/hir-def/src/expr_store/pretty.rs
+++ b/crates/hir-def/src/expr_store/pretty.rs
@@ -338,7 +338,17 @@ fn print_where_clauses(
w!(p, ",\n");
}
match pred {
- WherePredicate::TypeBound { target, bound } => {
+ WherePredicate::TypeBound { lifetimes, target, bound } => {
+ if let Some(lifetimes) = lifetimes {
+ w!(p, "for<");
+ for (i, lifetime) in lifetimes.iter().enumerate() {
+ if i != 0 {
+ w!(p, ", ");
+ }
+ w!(p, "{}", lifetime.display(db, p.edition));
+ }
+ w!(p, "> ");
+ }
p.print_type_ref(*target);
w!(p, ": ");
p.print_type_bounds(std::slice::from_ref(bound));
@@ -348,19 +358,6 @@ fn print_where_clauses(
w!(p, ": ");
p.print_lifetime_ref(*bound);
}
- WherePredicate::ForLifetime { lifetimes, target, bound } => {
- w!(p, "for<");
- for (i, lifetime) in lifetimes.iter().enumerate() {
- if i != 0 {
- w!(p, ", ");
- }
- w!(p, "{}", lifetime.display(db, p.edition));
- }
- w!(p, "> ");
- p.print_type_ref(*target);
- w!(p, ": ");
- p.print_type_bounds(std::slice::from_ref(bound));
- }
}
}
});