aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/code_model.rs
diff options
context:
space:
mode:
authorPaul Daniel Faria <[email protected]>2020-06-15 12:19:45 +0100
committerPaul Daniel Faria <[email protected]>2020-08-10 13:44:54 +0100
commitfd30134cf84b134259fe8140e513b152e37f3f88 (patch)
treedd1570e0399fe25a6d8eb3d0bfdbb1b11c51f50c /crates/ra_hir/src/code_model.rs
parent263f9a7f231a474dd56d02adbcd7c57d079e88fd (diff)
Remove token tree from ReprKind::Other variant, expose ReprKind higher, remove debug println.
Diffstat (limited to 'crates/ra_hir/src/code_model.rs')
-rw-r--r--crates/ra_hir/src/code_model.rs6
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 }