Remove deprecated roc_collections::soa things

This commit is contained in:
Richard Feldman 2024-10-21 23:17:20 -04:00
parent d796b3ec74
commit 8997c80573
No known key found for this signature in database
GPG key ID: DAC334802F365236
14 changed files with 42 additions and 39 deletions

View file

@ -5,12 +5,13 @@ use std::sync::Arc;
use crate::abilities::SpecializationId;
use crate::exhaustive::{ExhaustiveContext, SketchedRows};
use crate::expected::{Expected, PExpected};
use roc_collections::soa::{index_push_new, slice_extend_new, EitherIndex, Index, Slice};
use roc_collections::soa::{index_push_new, slice_extend_new};
use roc_module::ident::TagName;
use roc_module::symbol::{ModuleId, Symbol};
use roc_region::all::{Loc, Region};
use roc_types::subs::{ExhaustiveMark, IllegalCycleMark, Variable};
use roc_types::types::{Category, PatternCategory, TypeTag, Types};
use soa::{EitherIndex, Index, Slice};
pub struct Constraints {
pub constraints: Vec<Constraint>,

View file

@ -12,7 +12,7 @@ use crate::pattern::{canonicalize_pattern, BindingsFromPattern, Pattern, PermitS
use crate::procedure::{QualifiedReference, References};
use crate::scope::{Scope, SymbolLookup};
use crate::traverse::{walk_expr, Visitor};
use roc_collections::soa::{index_push_new, Index};
use roc_collections::soa::index_push_new;
use roc_collections::{SendMap, VecMap, VecSet};
use roc_error_macros::internal_error;
use roc_module::called_via::CalledVia;
@ -27,6 +27,7 @@ use roc_region::all::{Loc, Region};
use roc_types::num::SingleQuoteBound;
use roc_types::subs::{ExhaustiveMark, IllegalCycleMark, RedundantMark, VarStore, Variable};
use roc_types::types::{Alias, Category, IndexOrField, LambdaSet, OptAbleVar, Type};
use soa::Index;
use std::fmt::{Debug, Display};
use std::path::PathBuf;
use std::sync::Arc;

View file

@ -1,12 +1,3 @@
#[deprecated(note = "use soa::Index instead")]
pub type Index<T> = soa::Index<T>;
#[deprecated(note = "use soa::Slice instead")]
pub type Slice<T> = soa::Slice<T>;
#[deprecated(note = "use soa::EitherIndex instead")]
pub type EitherIndex<T, U> = soa::EitherIndex<T, U>;
/// Push to a std::vec::Vec<T> and then return an index to that new element's
/// position in the Vec.
///

View file

@ -18,3 +18,5 @@ roc_region = { path = "../region" }
roc_types = { path = "../types" }
arrayvec.workspace = true
soa.workspace = true

View file

@ -22,7 +22,6 @@ use roc_can::expr::{
use roc_can::pattern::Pattern;
use roc_can::traverse::symbols_introduced_from_pattern;
use roc_collections::all::{HumanIndex, MutMap, SendMap};
use roc_collections::soa::{Index, Slice};
use roc_collections::VecMap;
use roc_module::ident::Lowercase;
use roc_module::symbol::{ModuleId, Symbol};
@ -33,6 +32,7 @@ use roc_types::types::{
AliasKind, AnnotationSource, Category, IndexOrField, OptAbleType, PReason, Reason, RecordField,
TypeExtension, TypeTag, Types,
};
use soa::{Index, Slice};
/// This is for constraining Defs
#[derive(Default, Debug)]

View file

@ -5,7 +5,6 @@ use roc_can::expected::{Expected, PExpected};
use roc_can::pattern::Pattern::{self, *};
use roc_can::pattern::{DestructType, ListPatterns, RecordDestruct, TupleDestruct};
use roc_collections::all::{HumanIndex, SendMap};
use roc_collections::soa::Index;
use roc_collections::VecMap;
use roc_module::ident::Lowercase;
use roc_module::symbol::Symbol;
@ -15,6 +14,7 @@ use roc_types::types::{
AliasKind, AliasShared, Category, OptAbleType, PReason, PatternCategory, Reason, RecordField,
Type, TypeExtension, TypeTag, Types,
};
use soa::Index;
#[derive(Default, Debug)]
pub struct PatternState {
@ -171,8 +171,10 @@ fn headers_from_annotation_help(
return false;
}
arguments.iter().zip(arg_types_slice).all(
|(arg_pattern, arg_type)| {
arguments
.iter()
.zip(arg_types_slice)
.all(|(arg_pattern, arg_type)| {
headers_from_annotation_help(
types,
constraints,
@ -180,8 +182,7 @@ fn headers_from_annotation_help(
&Loc::at(annotation.region, arg_type),
headers,
)
},
)
})
} else {
false
}

View file

@ -16,6 +16,8 @@ roc_module = { path = "../module" }
roc_region = { path = "../region" }
roc_error_macros = { path = "../../error_macros" }
soa.workspace = true
bumpalo.workspace = true
encode_unicode.workspace = true

View file

@ -8,11 +8,12 @@ use crate::ident::Accessor;
use crate::parser::ESingleQuote;
use bumpalo::collections::{String, Vec};
use bumpalo::Bump;
use roc_collections::soa::{index_push_new, slice_extend_new, EitherIndex, Slice};
use roc_collections::soa::{index_push_new, slice_extend_new};
use roc_error_macros::internal_error;
use roc_module::called_via::{BinOp, CalledVia, UnaryOp};
use roc_module::ident::QualifiedModuleName;
use roc_region::all::{Loc, Position, Region};
use soa::{EitherIndex, Slice};
#[derive(Debug, Clone)]
pub struct FullAst<'a> {

View file

@ -27,6 +27,8 @@ roc_unify = { path = "../unify" }
arrayvec.workspace = true
bumpalo.workspace = true
soa.workspace = true
[dev-dependencies]
roc_builtins = { path = "../builtins" }
roc_derive = { path = "../derive", features = ["debug-derived-symbols"] }

View file

@ -1,8 +1,5 @@
use roc_can::abilities::AbilitiesStore;
use roc_collections::{
soa::{slice_extend_new, Index},
MutMap,
};
use roc_collections::{soa::slice_extend_new, MutMap};
use roc_error_macros::internal_error;
use roc_module::symbol::Symbol;
use roc_solve_problem::TypeError;
@ -10,6 +7,7 @@ use roc_types::{
subs::{AliasVariables, Content, FlatType, Rank, Subs, SubsSlice, TagExt, UnionTags, Variable},
types::{Alias, AliasKind, OptAbleVar, Type, TypeTag, Types},
};
use soa::Index;
use crate::to_var::type_to_var_help;
use crate::{ability::ObligationCache, env::InferenceEnv};

View file

@ -1,7 +1,7 @@
use std::cell::RefCell;
use roc_can::{abilities::AbilitiesStore, constraint::TypeOrVar, expected::Expected};
use roc_collections::soa::{slice_extend_new, Index, Slice};
use roc_collections::soa::slice_extend_new;
use roc_error_macros::internal_error;
use roc_module::{ident::TagName, symbol::Symbol};
use roc_region::all::Loc;
@ -19,6 +19,7 @@ use roc_types::{
},
};
use roc_unify::unify::{unify, Unified};
use soa::{Index, Slice};
use crate::{
ability::{AbilityImplError, ObligationCache},

View file

@ -5,7 +5,7 @@ use crate::subs::{
VariableSubsSlice,
};
use roc_collections::all::{HumanIndex, ImMap, ImSet, MutMap, MutSet, SendMap};
use roc_collections::soa::{index_push_new, slice_extend_new, Index, Slice};
use roc_collections::soa::{index_push_new, slice_extend_new};
use roc_collections::VecMap;
use roc_error_macros::internal_error;
use roc_module::called_via::CalledVia;
@ -13,6 +13,7 @@ use roc_module::ident::{ForeignSymbol, Lowercase, TagName};
use roc_module::low_level::LowLevel;
use roc_module::symbol::{Interns, ModuleId, Symbol};
use roc_region::all::{Loc, Region};
use soa::{Index, Slice};
use std::fmt;
use std::fmt::Write;
use std::path::PathBuf;
@ -1280,8 +1281,8 @@ mod debug_types {
};
use super::{TypeTag, Types};
use roc_collections::soa::{Index, Slice};
use roc_module::ident::TagName;
use soa::{Index, Slice};
use ven_pretty::{text, Arena, DocAllocator, DocBuilder};
pub struct DebugTag<'a>(pub &'a Types, pub Index<TypeTag>);
@ -1482,19 +1483,19 @@ mod debug_types {
ext_slice: Slice<TypeTag>,
) -> DocBuilder<'a, Arena<'a>> {
let (tags, payload_slices) = types.union_tag_slices(tags);
let fmt_tags =
tags.into_iter()
.zip(payload_slices)
.map(|(tag, payload_slice_index)| {
let payload_slice = types[payload_slice_index];
let fmt_payloads = payload_slice
.into_iter()
.map(|p| typ(types, f, TPrec::Arg, p));
let iter = Some(f.text(types[tag].0.to_string()))
.into_iter()
.chain(fmt_payloads);
f.intersperse(iter, f.text(" "))
});
let fmt_tags = tags
.into_iter()
.zip(payload_slices)
.map(|(tag, payload_slice_index)| {
let payload_slice = types[payload_slice_index];
let fmt_payloads = payload_slice
.into_iter()
.map(|p| typ(types, f, TPrec::Arg, p));
let iter = Some(f.text(types[tag].0.to_string()))
.into_iter()
.chain(fmt_payloads);
f.intersperse(iter, f.text(" "))
});
prefix.append(f.text("[")).append(
f.intersperse(fmt_tags, f.reflow(", "))