Remove unnecessary soa_index Id type alias

This commit is contained in:
Agus Zubiaga 2024-11-25 19:35:26 -03:00
parent 01892dcf20
commit c31b457428
No known key found for this signature in database
3 changed files with 9 additions and 11 deletions

View file

@ -1,5 +1,5 @@
use roc_module::ident::ForeignSymbol; use roc_module::ident::ForeignSymbol;
use soa::Id; use soa::Index;
#[derive(Debug, Default)] #[derive(Debug, Default)]
pub struct ForeignSymbols { pub struct ForeignSymbols {
@ -26,12 +26,12 @@ impl ForeignSymbols {
self.inner.push(entry); self.inner.push(entry);
ForeignSymbolId { ForeignSymbolId {
inner: Id::new(id as u32), inner: Index::new(id as u32),
} }
} }
} }
#[derive(Debug, Copy, Clone, PartialEq, Eq)] #[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct ForeignSymbolId { pub struct ForeignSymbolId {
inner: Id<ForeignSymbol>, inner: Index<ForeignSymbol>,
} }

View file

@ -6,7 +6,7 @@ use roc_can::expr::Recursive;
use roc_module::low_level::LowLevel; use roc_module::low_level::LowLevel;
use roc_module::symbol::Symbol; use roc_module::symbol::Symbol;
use roc_region::all::Region; use roc_region::all::Region;
use soa::{Id, Index, NonEmptySlice, Slice, Slice2, Slice3}; use soa::{Index, NonEmptySlice, Slice, Slice2, Slice3};
use std::iter; use std::iter;
#[derive(Clone, Copy, Debug, PartialEq)] #[derive(Clone, Copy, Debug, PartialEq)]
@ -46,7 +46,7 @@ impl MonoExprs {
self.regions.push(region); self.regions.push(region);
MonoExprId { MonoExprId {
inner: Id::new(index), inner: Index::new(index),
} }
} }
@ -146,22 +146,22 @@ impl MonoExprs {
#[derive(Clone, Copy, Debug, PartialEq, Eq)] #[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct MonoExprId { pub struct MonoExprId {
inner: Id<MonoExpr>, inner: Index<MonoExpr>,
} }
impl MonoExprId { impl MonoExprId {
pub(crate) unsafe fn new_unchecked(inner: Id<MonoExpr>) -> Self { pub(crate) unsafe fn new_unchecked(inner: Index<MonoExpr>) -> Self {
Self { inner } Self { inner }
} }
} }
#[derive(Clone, Copy, Debug, PartialEq, Eq)] #[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct MonoStmtId { pub struct MonoStmtId {
inner: Id<MonoStmt>, inner: Index<MonoStmt>,
} }
impl MonoStmtId { impl MonoStmtId {
pub(crate) unsafe fn new_unchecked(inner: Id<MonoStmt>) -> Self { pub(crate) unsafe fn new_unchecked(inner: Index<MonoStmt>) -> Self {
Self { inner } Self { inner }
} }
} }

View file

@ -8,8 +8,6 @@ use core::{
use crate::soa_slice::Slice; use crate::soa_slice::Slice;
pub type Id<T> = Index<T>;
/// An index into an array of values, based /// An index into an array of values, based
/// on an offset into the array rather than a pointer. /// on an offset into the array rather than a pointer.
/// ///