get fancy, store variable directly in the index

This commit is contained in:
Folkert 2022-03-13 01:59:28 +01:00
parent b3d9f9c2de
commit eccb461b01
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 6 additions and 3 deletions

View file

@ -890,8 +890,8 @@ fn either_type_index_to_var(
type_to_var(subs, rank, pools, _alias_map, typ)
}
Err(var_index) => {
let var = constraints.variables[var_index.index()];
var
// we cheat, and store the variable directly in the index
unsafe { Variable::from_index(var_index.index() as _) }
}
}
}