chalk icon indicating copy to clipboard operation
chalk copied to clipboard

refactor how RustIr manages ADTs (and maybe other types)

Open nikomatsakis opened this issue 4 years ago • 1 comments

Currently the RustIrDatabase trait has methods that return Arc<SomeRustIrType>, but this doesn't map that well to rustc, as it must create these awkward types. We could instead have finer-grained methods. For the case of ADTs, we might have e.g.:

  • num_variants(adt_id)
  • num_fields(adt_id, variant_index)
  • field_type(adt_id, variant_index, field_index)

This issue has been assigned to @doctorn via this comment.

nikomatsakis avatar Jun 09 '20 20:06 nikomatsakis

@rustbot claim

doctorn avatar Jun 09 '20 21:06 doctorn