mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
Move unique_builtins into builtins crate
This commit is contained in:
parent
cc92ca7e7c
commit
45bda2e0c7
9 changed files with 16 additions and 17 deletions
|
@ -10,4 +10,5 @@
|
||||||
// and encouraging shortcuts here creates bad incentives. I would rather temporarily
|
// and encouraging shortcuts here creates bad incentives. I would rather temporarily
|
||||||
// re-enable this when working on performance optimizations than have it block PRs.
|
// re-enable this when working on performance optimizations than have it block PRs.
|
||||||
#![allow(clippy::large_enum_variant)]
|
#![allow(clippy::large_enum_variant)]
|
||||||
pub mod all;
|
pub mod std;
|
||||||
|
pub mod unique;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use roc_builtins::all::StdLib;
|
use crate::std::StdLib;
|
||||||
use roc_collections::all::{default_hasher, MutMap};
|
use roc_collections::all::{default_hasher, MutMap};
|
||||||
use roc_module::ident::TagName;
|
use roc_module::ident::TagName;
|
||||||
use roc_module::symbol::Symbol;
|
use roc_module::symbol::Symbol;
|
||||||
|
@ -40,7 +40,7 @@ fn disjunction(free: VarId, rest: Vec<VarId>) -> SolvedType {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn uniqueness_stdlib() -> StdLib {
|
pub fn uniqueness_stdlib() -> StdLib {
|
||||||
use roc_builtins::all::Mode;
|
use crate::std::Mode;
|
||||||
|
|
||||||
let types = types();
|
let types = types();
|
||||||
let aliases = aliases();
|
let aliases = aliases();
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::expr::constrain_decls;
|
use crate::expr::constrain_decls;
|
||||||
use roc_builtins::all::Mode;
|
use roc_builtins::std::Mode;
|
||||||
use roc_can::constraint::{Constraint, LetConstraint};
|
use roc_can::constraint::{Constraint, LetConstraint};
|
||||||
use roc_can::def::Declaration;
|
use roc_can::def::Declaration;
|
||||||
use roc_collections::all::{ImMap, MutMap, SendMap};
|
use roc_collections::all::{ImMap, MutMap, SendMap};
|
||||||
|
|
|
@ -13,8 +13,6 @@
|
||||||
|
|
||||||
pub mod string;
|
pub mod string;
|
||||||
|
|
||||||
pub mod unique_builtins;
|
|
||||||
|
|
||||||
pub mod crane;
|
pub mod crane;
|
||||||
pub mod fmt;
|
pub mod fmt;
|
||||||
pub mod llvm;
|
pub mod llvm;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use bumpalo::Bump;
|
use bumpalo::Bump;
|
||||||
use roc_builtins::all::Mode;
|
use roc_builtins::std::Mode;
|
||||||
use roc_builtins::all::StdLib;
|
use roc_builtins::std::StdLib;
|
||||||
use roc_can;
|
use roc_can;
|
||||||
use roc_can::constraint::Constraint;
|
use roc_can::constraint::Constraint;
|
||||||
use roc_can::def::Declaration;
|
use roc_can::def::Declaration;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
extern crate bumpalo;
|
extern crate bumpalo;
|
||||||
|
|
||||||
use self::bumpalo::Bump;
|
use self::bumpalo::Bump;
|
||||||
use roc::unique_builtins;
|
use roc_builtins::unique;
|
||||||
use roc_can::constraint::Constraint;
|
use roc_can::constraint::Constraint;
|
||||||
use roc_can::env::Env;
|
use roc_can::env::Env;
|
||||||
use roc_can::expected::Expected;
|
use roc_can::expected::Expected;
|
||||||
|
@ -140,7 +140,7 @@ pub fn uniq_expr_with(
|
||||||
expected2,
|
expected2,
|
||||||
);
|
);
|
||||||
|
|
||||||
let stdlib = unique_builtins::uniqueness_stdlib();
|
let stdlib = unique::uniqueness_stdlib();
|
||||||
|
|
||||||
let types = stdlib.types;
|
let types = stdlib.types;
|
||||||
let imports: Vec<_> = types
|
let imports: Vec<_> = types
|
||||||
|
@ -223,7 +223,7 @@ pub fn can_expr_with(arena: &Bump, home: ModuleId, expr_str: &str) -> CanExprOut
|
||||||
expected,
|
expected,
|
||||||
);
|
);
|
||||||
|
|
||||||
let types = roc_builtins::all::types();
|
let types = roc_builtins::std::types();
|
||||||
|
|
||||||
let imports: Vec<_> = types
|
let imports: Vec<_> = types
|
||||||
.iter()
|
.iter()
|
||||||
|
@ -239,7 +239,7 @@ pub fn can_expr_with(arena: &Bump, home: ModuleId, expr_str: &str) -> CanExprOut
|
||||||
|
|
||||||
//load builtin types
|
//load builtin types
|
||||||
let mut constraint = roc_constrain::module::load_builtin_aliases(
|
let mut constraint = roc_constrain::module::load_builtin_aliases(
|
||||||
&roc_builtins::all::aliases(),
|
&roc_builtins::std::aliases(),
|
||||||
constraint,
|
constraint,
|
||||||
&var_store,
|
&var_store,
|
||||||
);
|
);
|
||||||
|
|
|
@ -46,7 +46,7 @@ mod test_load {
|
||||||
let src_dir = fixtures_dir().join(dir_name);
|
let src_dir = fixtures_dir().join(dir_name);
|
||||||
let filename = src_dir.join(format!("{}.roc", module_name));
|
let filename = src_dir.join(format!("{}.roc", module_name));
|
||||||
let loaded = load(
|
let loaded = load(
|
||||||
&roc_builtins::all::standard_stdlib(),
|
&roc_builtins::std::standard_stdlib(),
|
||||||
src_dir,
|
src_dir,
|
||||||
filename,
|
filename,
|
||||||
subs_by_module,
|
subs_by_module,
|
||||||
|
@ -140,7 +140,7 @@ mod test_load {
|
||||||
|
|
||||||
test_async(async {
|
test_async(async {
|
||||||
let loaded = load(
|
let loaded = load(
|
||||||
&roc_builtins::all::standard_stdlib(),
|
&roc_builtins::std::standard_stdlib(),
|
||||||
src_dir,
|
src_dir,
|
||||||
filename,
|
filename,
|
||||||
subs_by_module,
|
subs_by_module,
|
||||||
|
|
|
@ -17,7 +17,7 @@ mod test_uniqueness_load {
|
||||||
use inlinable_string::InlinableString;
|
use inlinable_string::InlinableString;
|
||||||
use roc::load::{load, LoadedModule};
|
use roc::load::{load, LoadedModule};
|
||||||
use roc::pretty_print_types::{content_to_string, name_all_type_vars};
|
use roc::pretty_print_types::{content_to_string, name_all_type_vars};
|
||||||
use roc::unique_builtins;
|
use roc_builtins::unique;
|
||||||
use roc_can::def::Declaration::*;
|
use roc_can::def::Declaration::*;
|
||||||
use roc_can::def::Def;
|
use roc_can::def::Def;
|
||||||
use roc_collections::all::MutMap;
|
use roc_collections::all::MutMap;
|
||||||
|
@ -46,7 +46,7 @@ mod test_uniqueness_load {
|
||||||
let src_dir = fixtures_dir().join(dir_name);
|
let src_dir = fixtures_dir().join(dir_name);
|
||||||
let filename = src_dir.join(format!("{}.roc", module_name));
|
let filename = src_dir.join(format!("{}.roc", module_name));
|
||||||
let loaded = load(
|
let loaded = load(
|
||||||
&unique_builtins::uniqueness_stdlib(),
|
&unique::uniqueness_stdlib(),
|
||||||
src_dir,
|
src_dir,
|
||||||
filename,
|
filename,
|
||||||
subs_by_module,
|
subs_by_module,
|
||||||
|
@ -140,7 +140,7 @@ mod test_uniqueness_load {
|
||||||
|
|
||||||
test_async(async {
|
test_async(async {
|
||||||
let loaded = load(
|
let loaded = load(
|
||||||
&roc_builtins::all::standard_stdlib(),
|
&roc_builtins::std::standard_stdlib(),
|
||||||
src_dir,
|
src_dir,
|
||||||
filename,
|
filename,
|
||||||
subs_by_module,
|
subs_by_module,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue