Merge pull request #4485 from roc-lang/types-soa

Types SoA and Type -> Variable conversion via SoA
This commit is contained in:
Folkert de Vries 2022-11-08 20:32:27 +01:00 committed by GitHub
commit 95f8bac859
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 980 additions and 217 deletions

View file

@ -1,11 +1,24 @@
use std::usize;
#[derive(PartialEq, Eq)]
pub struct Index<T> {
index: u32,
_marker: std::marker::PhantomData<T>,
}
impl<T> Eq for Index<T> {}
impl<T> PartialEq for Index<T> {
fn eq(&self, other: &Self) -> bool {
self.index == other.index
}
}
impl<T> std::hash::Hash for Index<T> {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.index.hash(state);
}
}
impl<T> Clone for Index<T> {
fn clone(&self) -> Self {
Self {