mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-30 11:37:31 +00:00
Salsa idiomize VariantFields query
This commit is contained in:
parent
332434aecd
commit
889d84a1be
33 changed files with 201 additions and 131 deletions
|
|
@ -2250,7 +2250,7 @@ impl ExprCollector<'_> {
|
|||
Some(ModuleDefId::ConstId(_)) => (None, Pat::Path(name.into())),
|
||||
Some(ModuleDefId::EnumVariantId(variant))
|
||||
// FIXME: This can cause a cycle if the user is writing invalid code
|
||||
if self.db.variant_fields(variant.into()).shape != FieldsShape::Record =>
|
||||
if variant.fields(self.db).shape != FieldsShape::Record =>
|
||||
{
|
||||
(None, Pat::Path(name.into()))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ pub fn print_variant_body_hir(db: &dyn DefDatabase, owner: VariantId, edition: E
|
|||
VariantId::UnionId(it) => format!("union {}", item_name(db, it, "<missing>")),
|
||||
};
|
||||
|
||||
let fields = db.variant_fields(owner);
|
||||
let fields = owner.fields(db);
|
||||
|
||||
let mut p = Printer {
|
||||
db,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue