mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
get rid of InPlace
This commit is contained in:
parent
3ba643df70
commit
af4ee51560
4 changed files with 26 additions and 80 deletions
|
@ -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>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue