use VecSet in References

This commit is contained in:
Folkert 2022-04-17 19:37:10 +02:00
parent aa21186997
commit dda4f46e67
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
3 changed files with 32 additions and 39 deletions

View file

@ -34,7 +34,7 @@ pub struct Output {
impl Output {
pub fn union(&mut self, other: Self) {
self.references.union_mut(other.references);
self.references.union_mut(&other.references);
if let (None, Some(later)) = (self.tail_call, other.tail_call) {
self.tail_call = Some(later);
@ -354,7 +354,7 @@ pub fn canonicalize_expr<'a>(
if let Var(symbol) = &can_update.value {
match canonicalize_fields(env, var_store, scope, region, fields.items) {
Ok((can_fields, mut output)) => {
output.references = output.references.union(update_out.references);
output.references.union_mut(&update_out.references);
let answer = Update {
record_var: var_store.fresh(),
@ -432,7 +432,7 @@ pub fn canonicalize_expr<'a>(
let (can_expr, elem_out) =
canonicalize_expr(env, var_store, scope, loc_elem.region, &loc_elem.value);
references = references.union(elem_out.references);
references.union_mut(&elem_out.references);
can_elems.push(can_expr);
}
@ -466,7 +466,7 @@ pub fn canonicalize_expr<'a>(
canonicalize_expr(env, var_store, scope, loc_arg.region, &loc_arg.value);
args.push((var_store.fresh(), arg_expr));
output.references = output.references.union(arg_out.references);
output.references.union_mut(&arg_out.references);
}
if let ast::Expr::OpaqueRef(name) = loc_fn.value {
@ -753,7 +753,7 @@ pub fn canonicalize_expr<'a>(
let (can_when_branch, branch_references) =
canonicalize_when_branch(env, var_store, scope, region, *branch, &mut output);
output.references = output.references.union(branch_references);
output.references.union_mut(&branch_references);
can_branches.push(can_when_branch);
}
@ -886,8 +886,8 @@ pub fn canonicalize_expr<'a>(
branches.push((loc_cond, loc_then));
output.references = output.references.union(cond_output.references);
output.references = output.references.union(then_output.references);
output.references.union_mut(&cond_output.references);
output.references.union_mut(&then_output.references);
}
let (loc_else, else_output) = canonicalize_expr(
@ -898,7 +898,7 @@ pub fn canonicalize_expr<'a>(
&final_else_branch.value,
);
output.references = output.references.union(else_output.references);
output.references.union_mut(&else_output.references);
(
If {
@ -1167,7 +1167,7 @@ fn canonicalize_fields<'a>(
});
}
output.references = output.references.union(field_out.references);
output.references.union_mut(&field_out.references);
}
Err(CanonicalizeFieldProblem::InvalidOptionalValue {
field_name,