chalk
chalk copied to clipboard
refactor how RustIr manages ADTs (and maybe other types)
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.
@rustbot claim