diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-10-31 13:41:12 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-10-31 13:41:12 +0000 |
commit | 9421e5be357e1f8604a2353a6809c7aa923a3de8 (patch) | |
tree | 1d1ca3aeb17592c9aaa2823f1548b211141b9e10 /crates/ra_hir/src/ty/lower.rs | |
parent | d067afb064a7fa67b172abf561b7d80740cd6f18 (diff) | |
parent | 09f9733ca67b74057c55b6e96f38223a73db6a6e (diff) |
Merge #2144
2144: move struct & enum data to hir_def r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty/lower.rs')
-rw-r--r-- | crates/ra_hir/src/ty/lower.rs | 8 |
1 files changed, 4 insertions, 4 deletions
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 { | |||
655 | } | 655 | } |
656 | 656 | ||
657 | fn fn_sig_for_struct_constructor(db: &impl HirDatabase, def: Struct) -> FnSig { | 657 | fn fn_sig_for_struct_constructor(db: &impl HirDatabase, def: Struct) -> FnSig { |
658 | let var_data = def.variant_data(db); | 658 | let struct_data = db.struct_data(def.id); |
659 | let fields = match var_data.fields() { | 659 | let fields = match struct_data.variant_data.fields() { |
660 | Some(fields) => fields, | 660 | Some(fields) => fields, |
661 | None => panic!("fn_sig_for_struct_constructor called on unit struct"), | 661 | None => panic!("fn_sig_for_struct_constructor called on unit struct"), |
662 | }; | 662 | }; |
@@ -671,8 +671,8 @@ fn fn_sig_for_struct_constructor(db: &impl HirDatabase, def: Struct) -> FnSig { | |||
671 | 671 | ||
672 | /// Build the type of a tuple struct constructor. | 672 | /// Build the type of a tuple struct constructor. |
673 | fn type_for_struct_constructor(db: &impl HirDatabase, def: Struct) -> Ty { | 673 | fn type_for_struct_constructor(db: &impl HirDatabase, def: Struct) -> Ty { |
674 | let var_data = def.variant_data(db); | 674 | let struct_data = db.struct_data(def.id); |
675 | if var_data.fields().is_none() { | 675 | if struct_data.variant_data.fields().is_none() { |
676 | return type_for_adt(db, def); // Unit struct | 676 | return type_for_adt(db, def); // Unit struct |
677 | } | 677 | } |
678 | let generics = def.generic_params(db); | 678 | let generics = def.generic_params(db); |