mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Remove deprecated roc_collections::soa things
This commit is contained in:
parent
d796b3ec74
commit
8997c80573
14 changed files with 42 additions and 39 deletions
3
Cargo.lock
generated
3
Cargo.lock
generated
|
@ -2461,6 +2461,7 @@ dependencies = [
|
||||||
"roc_problem",
|
"roc_problem",
|
||||||
"roc_region",
|
"roc_region",
|
||||||
"roc_types",
|
"roc_types",
|
||||||
|
"soa",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2901,6 +2902,7 @@ dependencies = [
|
||||||
"roc_error_macros",
|
"roc_error_macros",
|
||||||
"roc_module",
|
"roc_module",
|
||||||
"roc_region",
|
"roc_region",
|
||||||
|
"soa",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -3113,6 +3115,7 @@ dependencies = [
|
||||||
"roc_target",
|
"roc_target",
|
||||||
"roc_types",
|
"roc_types",
|
||||||
"roc_unify",
|
"roc_unify",
|
||||||
|
"soa",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"test_solve_helpers",
|
"test_solve_helpers",
|
||||||
]
|
]
|
||||||
|
|
|
@ -5,12 +5,13 @@ use std::sync::Arc;
|
||||||
use crate::abilities::SpecializationId;
|
use crate::abilities::SpecializationId;
|
||||||
use crate::exhaustive::{ExhaustiveContext, SketchedRows};
|
use crate::exhaustive::{ExhaustiveContext, SketchedRows};
|
||||||
use crate::expected::{Expected, PExpected};
|
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::ident::TagName;
|
||||||
use roc_module::symbol::{ModuleId, Symbol};
|
use roc_module::symbol::{ModuleId, Symbol};
|
||||||
use roc_region::all::{Loc, Region};
|
use roc_region::all::{Loc, Region};
|
||||||
use roc_types::subs::{ExhaustiveMark, IllegalCycleMark, Variable};
|
use roc_types::subs::{ExhaustiveMark, IllegalCycleMark, Variable};
|
||||||
use roc_types::types::{Category, PatternCategory, TypeTag, Types};
|
use roc_types::types::{Category, PatternCategory, TypeTag, Types};
|
||||||
|
use soa::{EitherIndex, Index, Slice};
|
||||||
|
|
||||||
pub struct Constraints {
|
pub struct Constraints {
|
||||||
pub constraints: Vec<Constraint>,
|
pub constraints: Vec<Constraint>,
|
||||||
|
|
|
@ -12,7 +12,7 @@ use crate::pattern::{canonicalize_pattern, BindingsFromPattern, Pattern, PermitS
|
||||||
use crate::procedure::{QualifiedReference, References};
|
use crate::procedure::{QualifiedReference, References};
|
||||||
use crate::scope::{Scope, SymbolLookup};
|
use crate::scope::{Scope, SymbolLookup};
|
||||||
use crate::traverse::{walk_expr, Visitor};
|
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_collections::{SendMap, VecMap, VecSet};
|
||||||
use roc_error_macros::internal_error;
|
use roc_error_macros::internal_error;
|
||||||
use roc_module::called_via::CalledVia;
|
use roc_module::called_via::CalledVia;
|
||||||
|
@ -27,6 +27,7 @@ use roc_region::all::{Loc, Region};
|
||||||
use roc_types::num::SingleQuoteBound;
|
use roc_types::num::SingleQuoteBound;
|
||||||
use roc_types::subs::{ExhaustiveMark, IllegalCycleMark, RedundantMark, VarStore, Variable};
|
use roc_types::subs::{ExhaustiveMark, IllegalCycleMark, RedundantMark, VarStore, Variable};
|
||||||
use roc_types::types::{Alias, Category, IndexOrField, LambdaSet, OptAbleVar, Type};
|
use roc_types::types::{Alias, Category, IndexOrField, LambdaSet, OptAbleVar, Type};
|
||||||
|
use soa::Index;
|
||||||
use std::fmt::{Debug, Display};
|
use std::fmt::{Debug, Display};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
|
@ -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
|
/// Push to a std::vec::Vec<T> and then return an index to that new element's
|
||||||
/// position in the Vec.
|
/// position in the Vec.
|
||||||
///
|
///
|
||||||
|
|
|
@ -18,3 +18,5 @@ roc_region = { path = "../region" }
|
||||||
roc_types = { path = "../types" }
|
roc_types = { path = "../types" }
|
||||||
|
|
||||||
arrayvec.workspace = true
|
arrayvec.workspace = true
|
||||||
|
|
||||||
|
soa.workspace = true
|
||||||
|
|
|
@ -22,7 +22,6 @@ use roc_can::expr::{
|
||||||
use roc_can::pattern::Pattern;
|
use roc_can::pattern::Pattern;
|
||||||
use roc_can::traverse::symbols_introduced_from_pattern;
|
use roc_can::traverse::symbols_introduced_from_pattern;
|
||||||
use roc_collections::all::{HumanIndex, MutMap, SendMap};
|
use roc_collections::all::{HumanIndex, MutMap, SendMap};
|
||||||
use roc_collections::soa::{Index, Slice};
|
|
||||||
use roc_collections::VecMap;
|
use roc_collections::VecMap;
|
||||||
use roc_module::ident::Lowercase;
|
use roc_module::ident::Lowercase;
|
||||||
use roc_module::symbol::{ModuleId, Symbol};
|
use roc_module::symbol::{ModuleId, Symbol};
|
||||||
|
@ -33,6 +32,7 @@ use roc_types::types::{
|
||||||
AliasKind, AnnotationSource, Category, IndexOrField, OptAbleType, PReason, Reason, RecordField,
|
AliasKind, AnnotationSource, Category, IndexOrField, OptAbleType, PReason, Reason, RecordField,
|
||||||
TypeExtension, TypeTag, Types,
|
TypeExtension, TypeTag, Types,
|
||||||
};
|
};
|
||||||
|
use soa::{Index, Slice};
|
||||||
|
|
||||||
/// This is for constraining Defs
|
/// This is for constraining Defs
|
||||||
#[derive(Default, Debug)]
|
#[derive(Default, Debug)]
|
||||||
|
|
|
@ -5,7 +5,6 @@ use roc_can::expected::{Expected, PExpected};
|
||||||
use roc_can::pattern::Pattern::{self, *};
|
use roc_can::pattern::Pattern::{self, *};
|
||||||
use roc_can::pattern::{DestructType, ListPatterns, RecordDestruct, TupleDestruct};
|
use roc_can::pattern::{DestructType, ListPatterns, RecordDestruct, TupleDestruct};
|
||||||
use roc_collections::all::{HumanIndex, SendMap};
|
use roc_collections::all::{HumanIndex, SendMap};
|
||||||
use roc_collections::soa::Index;
|
|
||||||
use roc_collections::VecMap;
|
use roc_collections::VecMap;
|
||||||
use roc_module::ident::Lowercase;
|
use roc_module::ident::Lowercase;
|
||||||
use roc_module::symbol::Symbol;
|
use roc_module::symbol::Symbol;
|
||||||
|
@ -15,6 +14,7 @@ use roc_types::types::{
|
||||||
AliasKind, AliasShared, Category, OptAbleType, PReason, PatternCategory, Reason, RecordField,
|
AliasKind, AliasShared, Category, OptAbleType, PReason, PatternCategory, Reason, RecordField,
|
||||||
Type, TypeExtension, TypeTag, Types,
|
Type, TypeExtension, TypeTag, Types,
|
||||||
};
|
};
|
||||||
|
use soa::Index;
|
||||||
|
|
||||||
#[derive(Default, Debug)]
|
#[derive(Default, Debug)]
|
||||||
pub struct PatternState {
|
pub struct PatternState {
|
||||||
|
@ -171,8 +171,10 @@ fn headers_from_annotation_help(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
arguments.iter().zip(arg_types_slice).all(
|
arguments
|
||||||
|(arg_pattern, arg_type)| {
|
.iter()
|
||||||
|
.zip(arg_types_slice)
|
||||||
|
.all(|(arg_pattern, arg_type)| {
|
||||||
headers_from_annotation_help(
|
headers_from_annotation_help(
|
||||||
types,
|
types,
|
||||||
constraints,
|
constraints,
|
||||||
|
@ -180,8 +182,7 @@ fn headers_from_annotation_help(
|
||||||
&Loc::at(annotation.region, arg_type),
|
&Loc::at(annotation.region, arg_type),
|
||||||
headers,
|
headers,
|
||||||
)
|
)
|
||||||
},
|
})
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,8 @@ roc_module = { path = "../module" }
|
||||||
roc_region = { path = "../region" }
|
roc_region = { path = "../region" }
|
||||||
roc_error_macros = { path = "../../error_macros" }
|
roc_error_macros = { path = "../../error_macros" }
|
||||||
|
|
||||||
|
soa.workspace = true
|
||||||
|
|
||||||
bumpalo.workspace = true
|
bumpalo.workspace = true
|
||||||
encode_unicode.workspace = true
|
encode_unicode.workspace = true
|
||||||
|
|
||||||
|
|
|
@ -8,11 +8,12 @@ use crate::ident::Accessor;
|
||||||
use crate::parser::ESingleQuote;
|
use crate::parser::ESingleQuote;
|
||||||
use bumpalo::collections::{String, Vec};
|
use bumpalo::collections::{String, Vec};
|
||||||
use bumpalo::Bump;
|
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_error_macros::internal_error;
|
||||||
use roc_module::called_via::{BinOp, CalledVia, UnaryOp};
|
use roc_module::called_via::{BinOp, CalledVia, UnaryOp};
|
||||||
use roc_module::ident::QualifiedModuleName;
|
use roc_module::ident::QualifiedModuleName;
|
||||||
use roc_region::all::{Loc, Position, Region};
|
use roc_region::all::{Loc, Position, Region};
|
||||||
|
use soa::{EitherIndex, Slice};
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct FullAst<'a> {
|
pub struct FullAst<'a> {
|
||||||
|
|
|
@ -27,6 +27,8 @@ roc_unify = { path = "../unify" }
|
||||||
arrayvec.workspace = true
|
arrayvec.workspace = true
|
||||||
bumpalo.workspace = true
|
bumpalo.workspace = true
|
||||||
|
|
||||||
|
soa.workspace = true
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
roc_builtins = { path = "../builtins" }
|
roc_builtins = { path = "../builtins" }
|
||||||
roc_derive = { path = "../derive", features = ["debug-derived-symbols"] }
|
roc_derive = { path = "../derive", features = ["debug-derived-symbols"] }
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
use roc_can::abilities::AbilitiesStore;
|
use roc_can::abilities::AbilitiesStore;
|
||||||
use roc_collections::{
|
use roc_collections::{soa::slice_extend_new, MutMap};
|
||||||
soa::{slice_extend_new, Index},
|
|
||||||
MutMap,
|
|
||||||
};
|
|
||||||
use roc_error_macros::internal_error;
|
use roc_error_macros::internal_error;
|
||||||
use roc_module::symbol::Symbol;
|
use roc_module::symbol::Symbol;
|
||||||
use roc_solve_problem::TypeError;
|
use roc_solve_problem::TypeError;
|
||||||
|
@ -10,6 +7,7 @@ use roc_types::{
|
||||||
subs::{AliasVariables, Content, FlatType, Rank, Subs, SubsSlice, TagExt, UnionTags, Variable},
|
subs::{AliasVariables, Content, FlatType, Rank, Subs, SubsSlice, TagExt, UnionTags, Variable},
|
||||||
types::{Alias, AliasKind, OptAbleVar, Type, TypeTag, Types},
|
types::{Alias, AliasKind, OptAbleVar, Type, TypeTag, Types},
|
||||||
};
|
};
|
||||||
|
use soa::Index;
|
||||||
|
|
||||||
use crate::to_var::type_to_var_help;
|
use crate::to_var::type_to_var_help;
|
||||||
use crate::{ability::ObligationCache, env::InferenceEnv};
|
use crate::{ability::ObligationCache, env::InferenceEnv};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
|
|
||||||
use roc_can::{abilities::AbilitiesStore, constraint::TypeOrVar, expected::Expected};
|
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_error_macros::internal_error;
|
||||||
use roc_module::{ident::TagName, symbol::Symbol};
|
use roc_module::{ident::TagName, symbol::Symbol};
|
||||||
use roc_region::all::Loc;
|
use roc_region::all::Loc;
|
||||||
|
@ -19,6 +19,7 @@ use roc_types::{
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use roc_unify::unify::{unify, Unified};
|
use roc_unify::unify::{unify, Unified};
|
||||||
|
use soa::{Index, Slice};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
ability::{AbilityImplError, ObligationCache},
|
ability::{AbilityImplError, ObligationCache},
|
||||||
|
|
|
@ -5,7 +5,7 @@ use crate::subs::{
|
||||||
VariableSubsSlice,
|
VariableSubsSlice,
|
||||||
};
|
};
|
||||||
use roc_collections::all::{HumanIndex, ImMap, ImSet, MutMap, MutSet, SendMap};
|
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_collections::VecMap;
|
||||||
use roc_error_macros::internal_error;
|
use roc_error_macros::internal_error;
|
||||||
use roc_module::called_via::CalledVia;
|
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::low_level::LowLevel;
|
||||||
use roc_module::symbol::{Interns, ModuleId, Symbol};
|
use roc_module::symbol::{Interns, ModuleId, Symbol};
|
||||||
use roc_region::all::{Loc, Region};
|
use roc_region::all::{Loc, Region};
|
||||||
|
use soa::{Index, Slice};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
@ -1280,8 +1281,8 @@ mod debug_types {
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{TypeTag, Types};
|
use super::{TypeTag, Types};
|
||||||
use roc_collections::soa::{Index, Slice};
|
|
||||||
use roc_module::ident::TagName;
|
use roc_module::ident::TagName;
|
||||||
|
use soa::{Index, Slice};
|
||||||
use ven_pretty::{text, Arena, DocAllocator, DocBuilder};
|
use ven_pretty::{text, Arena, DocAllocator, DocBuilder};
|
||||||
|
|
||||||
pub struct DebugTag<'a>(pub &'a Types, pub Index<TypeTag>);
|
pub struct DebugTag<'a>(pub &'a Types, pub Index<TypeTag>);
|
||||||
|
@ -1482,19 +1483,19 @@ mod debug_types {
|
||||||
ext_slice: Slice<TypeTag>,
|
ext_slice: Slice<TypeTag>,
|
||||||
) -> DocBuilder<'a, Arena<'a>> {
|
) -> DocBuilder<'a, Arena<'a>> {
|
||||||
let (tags, payload_slices) = types.union_tag_slices(tags);
|
let (tags, payload_slices) = types.union_tag_slices(tags);
|
||||||
let fmt_tags =
|
let fmt_tags = tags
|
||||||
tags.into_iter()
|
.into_iter()
|
||||||
.zip(payload_slices)
|
.zip(payload_slices)
|
||||||
.map(|(tag, payload_slice_index)| {
|
.map(|(tag, payload_slice_index)| {
|
||||||
let payload_slice = types[payload_slice_index];
|
let payload_slice = types[payload_slice_index];
|
||||||
let fmt_payloads = payload_slice
|
let fmt_payloads = payload_slice
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|p| typ(types, f, TPrec::Arg, p));
|
.map(|p| typ(types, f, TPrec::Arg, p));
|
||||||
let iter = Some(f.text(types[tag].0.to_string()))
|
let iter = Some(f.text(types[tag].0.to_string()))
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.chain(fmt_payloads);
|
.chain(fmt_payloads);
|
||||||
f.intersperse(iter, f.text(" "))
|
f.intersperse(iter, f.text(" "))
|
||||||
});
|
});
|
||||||
|
|
||||||
prefix.append(f.text("[")).append(
|
prefix.append(f.text("[")).append(
|
||||||
f.intersperse(fmt_tags, f.reflow(", "))
|
f.intersperse(fmt_tags, f.reflow(", "))
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
use core::{
|
use core::{
|
||||||
any,
|
|
||||||
cmp::Ordering,
|
cmp::Ordering,
|
||||||
fmt::{self, Formatter},
|
fmt::{self, Formatter},
|
||||||
hash::{Hash, Hasher},
|
hash::{Hash, Hasher},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue