mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Use chalk_ir::AdtId
This commit is contained in:
parent
16a76aa158
commit
50e01d2bc7
11 changed files with 68 additions and 73 deletions
|
@ -1700,7 +1700,7 @@ impl Type {
|
|||
|
||||
pub fn is_packed(&self, db: &dyn HirDatabase) -> bool {
|
||||
let adt_id = match self.ty.value {
|
||||
Ty::Adt(adt_id, ..) => adt_id,
|
||||
Ty::Adt(hir_ty::AdtId(adt_id), ..) => adt_id,
|
||||
_ => return false,
|
||||
};
|
||||
|
||||
|
@ -1728,8 +1728,8 @@ impl Type {
|
|||
|
||||
pub fn fields(&self, db: &dyn HirDatabase) -> Vec<(Field, Type)> {
|
||||
let (variant_id, substs) = match self.ty.value {
|
||||
Ty::Adt(AdtId::StructId(s), ref substs) => (s.into(), substs),
|
||||
Ty::Adt(AdtId::UnionId(u), ref substs) => (u.into(), substs),
|
||||
Ty::Adt(hir_ty::AdtId(AdtId::StructId(s)), ref substs) => (s.into(), substs),
|
||||
Ty::Adt(hir_ty::AdtId(AdtId::UnionId(u)), ref substs) => (u.into(), substs),
|
||||
_ => return Vec::new(),
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue