diff options
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 6f9c56d29..0007d7fa8 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -432,8 +432,8 @@ impl Struct { | |||
432 | Type::from_def(db, self.id.lookup(db.upcast()).container.module(db.upcast()).krate, self.id) | 432 | Type::from_def(db, self.id.lookup(db.upcast()).container.module(db.upcast()).krate, self.id) |
433 | } | 433 | } |
434 | 434 | ||
435 | pub fn is_packed(self, db: &dyn HirDatabase) -> bool { | 435 | pub fn repr(self, db: &dyn HirDatabase) -> Option<ReprKind> { |
436 | matches!(db.struct_data(self.id).repr, Some(ReprKind::Packed)) | 436 | db.struct_data(self.id).repr.clone() |
437 | } | 437 | } |
438 | 438 | ||
439 | fn variant_data(self, db: &dyn HirDatabase) -> Arc<VariantData> { | 439 | fn variant_data(self, db: &dyn HirDatabase) -> Arc<VariantData> { |
@@ -1266,7 +1266,7 @@ impl Type { | |||
1266 | 1266 | ||
1267 | let adt = adt_id.into(); | 1267 | let adt = adt_id.into(); |
1268 | match adt { | 1268 | match adt { |
1269 | Adt::Struct(s) => s.is_packed(db), | 1269 | Adt::Struct(s) => matches!(s.repr(db), Some(ReprKind::Packed)), |
1270 | _ => false, | 1270 | _ => false, |
1271 | } | 1271 | } |
1272 | } | 1272 | } |