From 0acdb730769cfb040ffc5e2c87f83b19fd3ce291 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Fri, 1 Jan 2021 10:06:42 +0100 Subject: Add ConstParams to the HIR --- crates/hir_def/src/item_tree.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'crates/hir_def/src/item_tree.rs') diff --git a/crates/hir_def/src/item_tree.rs b/crates/hir_def/src/item_tree.rs index 100dbf5d6..b6f510731 100644 --- a/crates/hir_def/src/item_tree.rs +++ b/crates/hir_def/src/item_tree.rs @@ -260,6 +260,7 @@ impl GenericParamsStorage { fn alloc(&mut self, params: GenericParams) -> GenericParamsId { if params.types.is_empty() && params.lifetimes.is_empty() + && params.consts.is_empty() && params.where_predicates.is_empty() { return GenericParamsId::EMPTY; @@ -269,8 +270,12 @@ impl GenericParamsStorage { } } -static EMPTY_GENERICS: GenericParams = - GenericParams { types: Arena::new(), lifetimes: Arena::new(), where_predicates: Vec::new() }; +static EMPTY_GENERICS: GenericParams = GenericParams { + types: Arena::new(), + lifetimes: Arena::new(), + consts: Arena::new(), + where_predicates: Vec::new(), +}; #[derive(Default, Debug, Eq, PartialEq)] struct ItemTreeData { -- cgit v1.2.3