1
Fork 0

Simplify slice indexing in next trait solver

This commit is contained in:
Yotam Ofek 2025-01-25 21:18:16 +00:00
parent f7cc13af82
commit e485cc5e02

View file

@ -442,13 +442,11 @@ where
{ {
// In case any fresh inference variables have been created between `state` // In case any fresh inference variables have been created between `state`
// and the previous instantiation, extend `orig_values` for it. // and the previous instantiation, extend `orig_values` for it.
assert!(orig_values.len() <= state.value.var_values.len()); orig_values.extend(
for &arg in &state.value.var_values.var_values.as_slice() state.value.var_values.var_values.as_slice()[orig_values.len()..]
[orig_values.len()..state.value.var_values.len()] .iter()
{ .map(|&arg| delegate.fresh_var_for_kind_with_span(arg, span)),
let unconstrained = delegate.fresh_var_for_kind_with_span(arg, span); );
orig_values.push(unconstrained);
}
let instantiation = let instantiation =
EvalCtxt::compute_query_response_instantiation_values(delegate, orig_values, &state); EvalCtxt::compute_query_response_instantiation_values(delegate, orig_values, &state);