From 09f9733ca67b74057c55b6e96f38223a73db6a6e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 31 Oct 2019 16:40:36 +0300 Subject: move struct & enum data to hir_def --- crates/ra_hir/src/ty/lower.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_hir/src/ty') diff --git a/crates/ra_hir/src/ty/lower.rs b/crates/ra_hir/src/ty/lower.rs index dd7cd979f..8e2834307 100644 --- a/crates/ra_hir/src/ty/lower.rs +++ b/crates/ra_hir/src/ty/lower.rs @@ -655,8 +655,8 @@ fn type_for_builtin(def: BuiltinType) -> Ty { } fn fn_sig_for_struct_constructor(db: &impl HirDatabase, def: Struct) -> FnSig { - let var_data = def.variant_data(db); - let fields = match var_data.fields() { + let struct_data = db.struct_data(def.id); + let fields = match struct_data.variant_data.fields() { Some(fields) => fields, None => panic!("fn_sig_for_struct_constructor called on unit struct"), }; @@ -671,8 +671,8 @@ fn fn_sig_for_struct_constructor(db: &impl HirDatabase, def: Struct) -> FnSig { /// Build the type of a tuple struct constructor. fn type_for_struct_constructor(db: &impl HirDatabase, def: Struct) -> Ty { - let var_data = def.variant_data(db); - if var_data.fields().is_none() { + let struct_data = db.struct_data(def.id); + if struct_data.variant_data.fields().is_none() { return type_for_adt(db, def); // Unit struct } let generics = def.generic_params(db); -- cgit v1.2.3