Skip to content

extend borrow checker to support unions #2

@nikomatsakis

Description

@nikomatsakis

It may take some experimentation to find the best way to express this: at present, we can just use simple stuff like foo.contains(...) to search for overlap, but with unions this doesn't quite work. Well, we could make it work by mapping all union field to a single "meta-field" (or by creating loans of all fields when one field is borrowed, as in the current implementation) -- but I'd prefer to avoid that, because if/when we scale to fields in traits, that approach doesn't work. It also doesn't help us deal with indices. To deal properly, we want to have the ability to have paths like a.b.c and a.b.d that are considered to alias, even though c != d.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions