Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_def/src/item_tree/pretty.rs')
| -rw-r--r-- | crates/hir_def/src/item_tree/pretty.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/hir_def/src/item_tree/pretty.rs b/crates/hir_def/src/item_tree/pretty.rs index 34bea5bd45..b24ba61ea0 100644 --- a/crates/hir_def/src/item_tree/pretty.rs +++ b/crates/hir_def/src/item_tree/pretty.rs @@ -621,12 +621,13 @@ impl<'a> Printer<'a> { fn print_generic_arg(&mut self, arg: &GenericArg) { match arg { GenericArg::Type(ty) => self.print_type_ref(ty), + GenericArg::Const(c) => w!(self, "{}", c), GenericArg::Lifetime(lt) => w!(self, "{}", lt.name), } } fn print_generic_params(&mut self, params: &GenericParams) { - if params.tocs.is_empty() && params.lifetimes.is_empty() { + if params.type_or_consts.is_empty() && params.lifetimes.is_empty() { return; } @@ -639,7 +640,7 @@ impl<'a> Printer<'a> { first = false; w!(self, "{}", lt.name); } - for (idx, x) in params.tocs.iter() { + for (idx, x) in params.type_or_consts.iter() { if !first { w!(self, ", "); } @@ -701,7 +702,7 @@ impl<'a> Printer<'a> { match target { WherePredicateTypeTarget::TypeRef(ty) => this.print_type_ref(ty), WherePredicateTypeTarget::TypeOrConstParam(id) => { - match ¶ms.tocs[*id].name() { + match ¶ms.type_or_consts[*id].name() { Some(name) => w!(this, "{}", name), None => w!(this, "_anon_{}", id.into_raw()), } |