Avoid an allocation

This commit is contained in:
Ayaz Hafiz 2022-05-11 11:20:17 -04:00
parent d0c6c06ca1
commit 7420276116
No known key found for this signature in database
GPG Key ID: 0E2A37416A25EF58

View File

@ -1677,16 +1677,15 @@ fn constrain_typed_function_arguments(
}
}
#[inline(always)]
fn attach_resolution_constraints(
constraints: &mut Constraints,
env: &mut Env,
constraint: Constraint,
) -> Constraint {
let resolution_constrs = env.resolutions_to_make.drain(..).map(Constraint::Resolve);
let all_constrs: Vec<_> = std::iter::once(constraint)
.chain(resolution_constrs)
.collect();
constraints.and_constraint(all_constrs)
let resolution_constrs =
constraints.and_constraint(env.resolutions_to_make.drain(..).map(Constraint::Resolve));
constraints.and_constraint([constraint, resolution_constrs])
}
fn constrain_def(