aboutsummaryrefslogtreecommitdiff
path: root/crates/hir
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-05 16:04:49 +0000
committerGitHub <[email protected]>2021-03-05 16:04:49 +0000
commit6c27c55041953327d341f4e7c705e8887fc4dd50 (patch)
treebcc8bcac74fa61c816986b0635defa7c7512660f /crates/hir
parent25a43e24c81f7b51234fc4e65e5e36ddbe3d60f1 (diff)
parent50e01d2bc7429d718e0783d75458a6a047ee2b70 (diff)
Merge #7870
7870: Use chalk_ir::AdtId r=Veykril a=Veykril It's a bit unfortunate that we got two AdtId's now(technically 3 with the alias in the chalk module but that one won't allow pattern matching), one from hir_def and one from chalk_ir(hir_ty). But the hir_ty/chalk one doesn't leave hir so it shouldn't be that bad I suppose. Though if I see this right this will happen for almost all IDs. I imagine most of the intermediate changes to using chalk ids will turn out not too nice until the refactor is over. Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/hir')
-rw-r--r--crates/hir/src/code_model.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs
index fc1a74641..7656db974 100644
--- a/crates/hir/src/code_model.rs
+++ b/crates/hir/src/code_model.rs
@@ -1700,7 +1700,7 @@ impl Type {
1700 1700
1701 pub fn is_packed(&self, db: &dyn HirDatabase) -> bool { 1701 pub fn is_packed(&self, db: &dyn HirDatabase) -> bool {
1702 let adt_id = match self.ty.value { 1702 let adt_id = match self.ty.value {
1703 Ty::Adt(adt_id, ..) => adt_id, 1703 Ty::Adt(hir_ty::AdtId(adt_id), ..) => adt_id,
1704 _ => return false, 1704 _ => return false,
1705 }; 1705 };
1706 1706
@@ -1728,8 +1728,8 @@ impl Type {
1728 1728
1729 pub fn fields(&self, db: &dyn HirDatabase) -> Vec<(Field, Type)> { 1729 pub fn fields(&self, db: &dyn HirDatabase) -> Vec<(Field, Type)> {
1730 let (variant_id, substs) = match self.ty.value { 1730 let (variant_id, substs) = match self.ty.value {
1731 Ty::Adt(AdtId::StructId(s), ref substs) => (s.into(), substs), 1731 Ty::Adt(hir_ty::AdtId(AdtId::StructId(s)), ref substs) => (s.into(), substs),
1732 Ty::Adt(AdtId::UnionId(u), ref substs) => (u.into(), substs), 1732 Ty::Adt(hir_ty::AdtId(AdtId::UnionId(u)), ref substs) => (u.into(), substs),
1733 _ => return Vec::new(), 1733 _ => return Vec::new(),
1734 }; 1734 };
1735 1735