get rid of InPlace

This commit is contained in:
Folkert 2021-06-19 16:56:27 +02:00
parent 3ba643df70
commit af4ee51560
4 changed files with 26 additions and 80 deletions

View file

@ -20,13 +20,6 @@ impl Layout<'_> {
pub const TAG_SIZE: Layout<'static> = Layout::Builtin(Builtin::Int64);
}
#[derive(Copy, Clone)]
#[repr(u8)]
pub enum InPlace {
InPlace,
Clone,
}
#[derive(Debug, Clone)]
pub enum LayoutProblem {
UnresolvedTypeVar(Variable),
@ -60,19 +53,6 @@ pub enum Layout<'a> {
Closure(&'a [Layout<'a>], LambdaSet<'a>, &'a Layout<'a>),
}
impl<'a> Layout<'a> {
pub fn in_place(&self) -> InPlace {
match self {
Layout::Builtin(Builtin::EmptyList) => InPlace::InPlace,
Layout::Builtin(Builtin::List(_)) => InPlace::Clone,
Layout::Builtin(Builtin::EmptyStr) => InPlace::InPlace,
Layout::Builtin(Builtin::Str) => InPlace::Clone,
Layout::Builtin(Builtin::Int1) => InPlace::Clone,
_ => unreachable!("Layout {:?} does not have an inplace", self),
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum UnionLayout<'a> {
/// A non-recursive tag union
@ -720,8 +700,6 @@ impl<'a> CachedVariable<'a> {
}
}
// use ven_ena::unify::{InPlace, Snapshot, UnificationTable, UnifyKey};
impl<'a> ven_ena::unify::UnifyKey for CachedVariable<'a> {
type Value = CachedLayout<'a>;