diff --git a/Cargo.lock b/Cargo.lock index a373df043a..e303dda741 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3682,6 +3682,13 @@ dependencies = [ [[package]] name = "roc_load" version = "0.1.0" +dependencies = [ + "roc_load_internal", +] + +[[package]] +name = "roc_load_internal" +version = "0.1.0" dependencies = [ "bumpalo", "crossbeam", diff --git a/Cargo.toml b/Cargo.toml index 482c686b7e..1e721c0d62 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,7 @@ members = [ "compiler/alias_analysis", "compiler/test_mono", "compiler/load", + "compiler/load_internal", "compiler/gen_llvm", "compiler/gen_dev", "compiler/gen_wasm", diff --git a/ast/src/module.rs b/ast/src/module.rs index 7abf2fc2ce..55b324b35d 100644 --- a/ast/src/module.rs +++ b/ast/src/module.rs @@ -1,14 +1,14 @@ use std::path::Path; use bumpalo::Bump; -use roc_load::file::LoadedModule; +use roc_load::LoadedModule; use roc_target::TargetInfo; pub fn load_module(src_file: &Path) -> LoadedModule { let subs_by_module = Default::default(); let arena = Bump::new(); - let loaded = roc_load::file::load_and_typecheck( + let loaded = roc_load::load_and_typecheck( &arena, src_file.to_path_buf(), src_file.parent().unwrap_or_else(|| { @@ -23,7 +23,7 @@ pub fn load_module(src_file: &Path) -> LoadedModule { match loaded { Ok(x) => x, - Err(roc_load::file::LoadingProblem::FormattedReport(report)) => { + Err(roc_load::LoadingProblem::FormattedReport(report)) => { panic!( "Failed to load module from src_file {:?}. Report: {}", src_file, report diff --git a/cli/src/build.rs b/cli/src/build.rs index 78cf4823bf..a32c5c1e23 100644 --- a/cli/src/build.rs +++ b/cli/src/build.rs @@ -4,7 +4,7 @@ use roc_build::{ program, }; use roc_builtins::bitcode; -use roc_load::file::LoadingProblem; +use roc_load::LoadingProblem; use roc_mono::ir::OptLevel; use roc_target::TargetInfo; use std::path::PathBuf; @@ -62,7 +62,7 @@ pub fn build_file<'a>( // Step 1: compile the app and generate the .o file let subs_by_module = Default::default(); - let loaded = roc_load::file::load_and_monomorphize( + let loaded = roc_load::load_and_monomorphize( arena, roc_file_path.clone(), src_dir.as_path(), @@ -363,7 +363,7 @@ pub fn check_file( // Step 1: compile the app and generate the .o file let subs_by_module = Default::default(); - let mut loaded = roc_load::file::load_and_typecheck( + let mut loaded = roc_load::load_and_typecheck( arena, roc_file_path, src_dir.as_path(), diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 49debcc7b3..54620dbfc8 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -6,7 +6,7 @@ use bumpalo::Bump; use clap::{App, AppSettings, Arg, ArgMatches}; use roc_build::link::LinkType; use roc_error_macros::user_error; -use roc_load::file::LoadingProblem; +use roc_load::LoadingProblem; use roc_mono::ir::OptLevel; use std::env; use std::io; diff --git a/cli/src/main.rs b/cli/src/main.rs index f07ecdd943..6a5c984ef3 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -3,7 +3,7 @@ use roc_cli::{ build_app, docs, format, BuildConfig, FormatMode, CMD_BUILD, CMD_CHECK, CMD_DOCS, CMD_EDIT, CMD_FORMAT, CMD_REPL, CMD_VERSION, DIRECTORY_OR_FILES, FLAG_CHECK, FLAG_TIME, ROC_FILE, }; -use roc_load::file::LoadingProblem; +use roc_load::LoadingProblem; use std::fs::{self, FileType}; use std::io; use std::path::{Path, PathBuf}; diff --git a/compiler/build/src/program.rs b/compiler/build/src/program.rs index 8db3cbbb86..eb62f713f9 100644 --- a/compiler/build/src/program.rs +++ b/compiler/build/src/program.rs @@ -2,7 +2,7 @@ use roc_gen_llvm::llvm::build::module_from_builtins; #[cfg(feature = "llvm")] pub use roc_gen_llvm::llvm::build::FunctionIterator; -use roc_load::file::{LoadedModule, MonomorphizedModule}; +use roc_load::{LoadedModule, MonomorphizedModule}; use roc_module::symbol::{Interns, ModuleId}; use roc_mono::ir::OptLevel; use roc_region::all::LineInfo; diff --git a/compiler/load/Cargo.toml b/compiler/load/Cargo.toml index afb62d8b77..397c939a57 100644 --- a/compiler/load/Cargo.toml +++ b/compiler/load/Cargo.toml @@ -6,32 +6,7 @@ license = "UPL-1.0" edition = "2018" [dependencies] -roc_collections = { path = "../collections" } -roc_error_macros = { path = "../../error_macros" } -roc_region = { path = "../region" } -roc_module = { path = "../module" } -roc_types = { path = "../types" } -roc_can = { path = "../can" } -roc_constrain = { path = "../constrain" } -roc_builtins = { path = "../builtins" } -roc_problem = { path = "../problem" } -roc_unify = { path = "../unify" } -roc_parse = { path = "../parse" } -roc_solve = { path = "../solve" } -roc_mono = { path = "../mono" } -roc_target = { path = "../roc_target" } -roc_reporting = { path = "../../reporting" } -morphic_lib = { path = "../../vendor/morphic_lib" } -ven_pretty = { path = "../../vendor/pretty" } -bumpalo = { version = "3.8.0", features = ["collections"] } -parking_lot = "0.11.2" -crossbeam = "0.8.1" -num_cpus = "1.13.0" -memmap = "0.7.0" +roc_load_internal = { path = "../load_internal" } -[dev-dependencies] -tempfile = "3.2.0" -pretty_assertions = "1.0.0" -maplit = "1.0.2" -indoc = "1.0.3" -strip-ansi-escapes = "0.1.1" +[build-dependencies] +roc_load_internal = { path = "../load_internal" } diff --git a/compiler/load/src/lib.rs b/compiler/load/src/lib.rs index 474a9bc679..95e4a0ca6c 100644 --- a/compiler/load/src/lib.rs +++ b/compiler/load/src/lib.rs @@ -1,9 +1,6 @@ -#![warn(clippy::dbg_macro)] -// See github.com/rtfeldman/roc/issues/800 for discussion of the large_enum_variant check. -#![allow(clippy::large_enum_variant)] -pub mod docs; -pub mod file; -mod work; +pub use roc_load_internal::file::{ + load_and_monomorphize, load_and_monomorphize_from_str, load_and_typecheck, LoadedModule, + LoadingProblem, MonomorphizedModule, +}; -#[cfg(target_family = "wasm")] -mod wasm_system_time; +pub use roc_load_internal::docs; diff --git a/compiler/load_internal/Cargo.toml b/compiler/load_internal/Cargo.toml new file mode 100644 index 0000000000..58e4dc30df --- /dev/null +++ b/compiler/load_internal/Cargo.toml @@ -0,0 +1,37 @@ +[package] +name = "roc_load_internal" +version = "0.1.0" +authors = ["The Roc Contributors"] +license = "UPL-1.0" +edition = "2018" + +[dependencies] +roc_collections = { path = "../collections" } +roc_error_macros = { path = "../../error_macros" } +roc_region = { path = "../region" } +roc_module = { path = "../module" } +roc_types = { path = "../types" } +roc_can = { path = "../can" } +roc_constrain = { path = "../constrain" } +roc_builtins = { path = "../builtins" } +roc_problem = { path = "../problem" } +roc_unify = { path = "../unify" } +roc_parse = { path = "../parse" } +roc_solve = { path = "../solve" } +roc_mono = { path = "../mono" } +roc_target = { path = "../roc_target" } +roc_reporting = { path = "../../reporting" } +morphic_lib = { path = "../../vendor/morphic_lib" } +ven_pretty = { path = "../../vendor/pretty" } +bumpalo = { version = "3.8.0", features = ["collections"] } +parking_lot = "0.11.2" +crossbeam = "0.8.1" +num_cpus = "1.13.0" +memmap = "0.7.0" + +[dev-dependencies] +tempfile = "3.2.0" +pretty_assertions = "1.0.0" +maplit = "1.0.2" +indoc = "1.0.3" +strip-ansi-escapes = "0.1.1" diff --git a/compiler/load/src/docs.rs b/compiler/load_internal/src/docs.rs similarity index 100% rename from compiler/load/src/docs.rs rename to compiler/load_internal/src/docs.rs diff --git a/compiler/load/src/file.rs b/compiler/load_internal/src/file.rs similarity index 100% rename from compiler/load/src/file.rs rename to compiler/load_internal/src/file.rs diff --git a/compiler/load_internal/src/lib.rs b/compiler/load_internal/src/lib.rs new file mode 100644 index 0000000000..474a9bc679 --- /dev/null +++ b/compiler/load_internal/src/lib.rs @@ -0,0 +1,9 @@ +#![warn(clippy::dbg_macro)] +// See github.com/rtfeldman/roc/issues/800 for discussion of the large_enum_variant check. +#![allow(clippy::large_enum_variant)] +pub mod docs; +pub mod file; +mod work; + +#[cfg(target_family = "wasm")] +mod wasm_system_time; diff --git a/compiler/load/src/wasm_system_time.rs b/compiler/load_internal/src/wasm_system_time.rs similarity index 100% rename from compiler/load/src/wasm_system_time.rs rename to compiler/load_internal/src/wasm_system_time.rs diff --git a/compiler/load/src/work.rs b/compiler/load_internal/src/work.rs similarity index 100% rename from compiler/load/src/work.rs rename to compiler/load_internal/src/work.rs diff --git a/compiler/load/tests/fixtures/build/app_with_deps/AStar.roc b/compiler/load_internal/tests/fixtures/build/app_with_deps/AStar.roc similarity index 100% rename from compiler/load/tests/fixtures/build/app_with_deps/AStar.roc rename to compiler/load_internal/tests/fixtures/build/app_with_deps/AStar.roc diff --git a/compiler/load/tests/fixtures/build/app_with_deps/Dep1.roc b/compiler/load_internal/tests/fixtures/build/app_with_deps/Dep1.roc similarity index 100% rename from compiler/load/tests/fixtures/build/app_with_deps/Dep1.roc rename to compiler/load_internal/tests/fixtures/build/app_with_deps/Dep1.roc diff --git a/compiler/load/tests/fixtures/build/app_with_deps/Dep2.roc b/compiler/load_internal/tests/fixtures/build/app_with_deps/Dep2.roc similarity index 100% rename from compiler/load/tests/fixtures/build/app_with_deps/Dep2.roc rename to compiler/load_internal/tests/fixtures/build/app_with_deps/Dep2.roc diff --git a/compiler/load/tests/fixtures/build/app_with_deps/Dep3/Blah.roc b/compiler/load_internal/tests/fixtures/build/app_with_deps/Dep3/Blah.roc similarity index 100% rename from compiler/load/tests/fixtures/build/app_with_deps/Dep3/Blah.roc rename to compiler/load_internal/tests/fixtures/build/app_with_deps/Dep3/Blah.roc diff --git a/compiler/load/tests/fixtures/build/app_with_deps/ImportAlias.roc b/compiler/load_internal/tests/fixtures/build/app_with_deps/ImportAlias.roc similarity index 100% rename from compiler/load/tests/fixtures/build/app_with_deps/ImportAlias.roc rename to compiler/load_internal/tests/fixtures/build/app_with_deps/ImportAlias.roc diff --git a/compiler/load/tests/fixtures/build/app_with_deps/ManualAttr.roc b/compiler/load_internal/tests/fixtures/build/app_with_deps/ManualAttr.roc similarity index 100% rename from compiler/load/tests/fixtures/build/app_with_deps/ManualAttr.roc rename to compiler/load_internal/tests/fixtures/build/app_with_deps/ManualAttr.roc diff --git a/compiler/load/tests/fixtures/build/app_with_deps/OneDep.roc b/compiler/load_internal/tests/fixtures/build/app_with_deps/OneDep.roc similarity index 100% rename from compiler/load/tests/fixtures/build/app_with_deps/OneDep.roc rename to compiler/load_internal/tests/fixtures/build/app_with_deps/OneDep.roc diff --git a/compiler/load/tests/fixtures/build/app_with_deps/Primary.roc b/compiler/load_internal/tests/fixtures/build/app_with_deps/Primary.roc similarity index 100% rename from compiler/load/tests/fixtures/build/app_with_deps/Primary.roc rename to compiler/load_internal/tests/fixtures/build/app_with_deps/Primary.roc diff --git a/compiler/load/tests/fixtures/build/app_with_deps/Quicksort.roc b/compiler/load_internal/tests/fixtures/build/app_with_deps/Quicksort.roc similarity index 100% rename from compiler/load/tests/fixtures/build/app_with_deps/Quicksort.roc rename to compiler/load_internal/tests/fixtures/build/app_with_deps/Quicksort.roc diff --git a/compiler/load/tests/fixtures/build/app_with_deps/QuicksortOneDef.roc b/compiler/load_internal/tests/fixtures/build/app_with_deps/QuicksortOneDef.roc similarity index 100% rename from compiler/load/tests/fixtures/build/app_with_deps/QuicksortOneDef.roc rename to compiler/load_internal/tests/fixtures/build/app_with_deps/QuicksortOneDef.roc diff --git a/compiler/load/tests/fixtures/build/app_with_deps/Records.roc b/compiler/load_internal/tests/fixtures/build/app_with_deps/Records.roc similarity index 100% rename from compiler/load/tests/fixtures/build/app_with_deps/Records.roc rename to compiler/load_internal/tests/fixtures/build/app_with_deps/Records.roc diff --git a/compiler/load/tests/fixtures/build/app_with_deps/Res.roc b/compiler/load_internal/tests/fixtures/build/app_with_deps/Res.roc similarity index 100% rename from compiler/load/tests/fixtures/build/app_with_deps/Res.roc rename to compiler/load_internal/tests/fixtures/build/app_with_deps/Res.roc diff --git a/compiler/load/tests/fixtures/build/app_with_deps/WithBuiltins.roc b/compiler/load_internal/tests/fixtures/build/app_with_deps/WithBuiltins.roc similarity index 100% rename from compiler/load/tests/fixtures/build/app_with_deps/WithBuiltins.roc rename to compiler/load_internal/tests/fixtures/build/app_with_deps/WithBuiltins.roc diff --git a/compiler/load/tests/fixtures/build/interface_with_deps/AStar.roc b/compiler/load_internal/tests/fixtures/build/interface_with_deps/AStar.roc similarity index 100% rename from compiler/load/tests/fixtures/build/interface_with_deps/AStar.roc rename to compiler/load_internal/tests/fixtures/build/interface_with_deps/AStar.roc diff --git a/compiler/load/tests/fixtures/build/interface_with_deps/Dep1.roc b/compiler/load_internal/tests/fixtures/build/interface_with_deps/Dep1.roc similarity index 100% rename from compiler/load/tests/fixtures/build/interface_with_deps/Dep1.roc rename to compiler/load_internal/tests/fixtures/build/interface_with_deps/Dep1.roc diff --git a/compiler/load/tests/fixtures/build/interface_with_deps/Dep2.roc b/compiler/load_internal/tests/fixtures/build/interface_with_deps/Dep2.roc similarity index 100% rename from compiler/load/tests/fixtures/build/interface_with_deps/Dep2.roc rename to compiler/load_internal/tests/fixtures/build/interface_with_deps/Dep2.roc diff --git a/compiler/load/tests/fixtures/build/interface_with_deps/Dep3/Blah.roc b/compiler/load_internal/tests/fixtures/build/interface_with_deps/Dep3/Blah.roc similarity index 100% rename from compiler/load/tests/fixtures/build/interface_with_deps/Dep3/Blah.roc rename to compiler/load_internal/tests/fixtures/build/interface_with_deps/Dep3/Blah.roc diff --git a/compiler/load/tests/fixtures/build/interface_with_deps/ImportAlias.roc b/compiler/load_internal/tests/fixtures/build/interface_with_deps/ImportAlias.roc similarity index 100% rename from compiler/load/tests/fixtures/build/interface_with_deps/ImportAlias.roc rename to compiler/load_internal/tests/fixtures/build/interface_with_deps/ImportAlias.roc diff --git a/compiler/load/tests/fixtures/build/interface_with_deps/ManualAttr.roc b/compiler/load_internal/tests/fixtures/build/interface_with_deps/ManualAttr.roc similarity index 100% rename from compiler/load/tests/fixtures/build/interface_with_deps/ManualAttr.roc rename to compiler/load_internal/tests/fixtures/build/interface_with_deps/ManualAttr.roc diff --git a/compiler/load/tests/fixtures/build/interface_with_deps/OneDep.roc b/compiler/load_internal/tests/fixtures/build/interface_with_deps/OneDep.roc similarity index 100% rename from compiler/load/tests/fixtures/build/interface_with_deps/OneDep.roc rename to compiler/load_internal/tests/fixtures/build/interface_with_deps/OneDep.roc diff --git a/compiler/load/tests/fixtures/build/interface_with_deps/Primary.roc b/compiler/load_internal/tests/fixtures/build/interface_with_deps/Primary.roc similarity index 100% rename from compiler/load/tests/fixtures/build/interface_with_deps/Primary.roc rename to compiler/load_internal/tests/fixtures/build/interface_with_deps/Primary.roc diff --git a/compiler/load/tests/fixtures/build/interface_with_deps/Quicksort.roc b/compiler/load_internal/tests/fixtures/build/interface_with_deps/Quicksort.roc similarity index 100% rename from compiler/load/tests/fixtures/build/interface_with_deps/Quicksort.roc rename to compiler/load_internal/tests/fixtures/build/interface_with_deps/Quicksort.roc diff --git a/compiler/load/tests/fixtures/build/interface_with_deps/Records.roc b/compiler/load_internal/tests/fixtures/build/interface_with_deps/Records.roc similarity index 100% rename from compiler/load/tests/fixtures/build/interface_with_deps/Records.roc rename to compiler/load_internal/tests/fixtures/build/interface_with_deps/Records.roc diff --git a/compiler/load/tests/fixtures/build/interface_with_deps/Res.roc b/compiler/load_internal/tests/fixtures/build/interface_with_deps/Res.roc similarity index 100% rename from compiler/load/tests/fixtures/build/interface_with_deps/Res.roc rename to compiler/load_internal/tests/fixtures/build/interface_with_deps/Res.roc diff --git a/compiler/load/tests/fixtures/build/interface_with_deps/WithBuiltins.roc b/compiler/load_internal/tests/fixtures/build/interface_with_deps/WithBuiltins.roc similarity index 100% rename from compiler/load/tests/fixtures/build/interface_with_deps/WithBuiltins.roc rename to compiler/load_internal/tests/fixtures/build/interface_with_deps/WithBuiltins.roc diff --git a/compiler/load/tests/fixtures/build/no_deps/MissingDep.roc b/compiler/load_internal/tests/fixtures/build/no_deps/MissingDep.roc similarity index 100% rename from compiler/load/tests/fixtures/build/no_deps/MissingDep.roc rename to compiler/load_internal/tests/fixtures/build/no_deps/MissingDep.roc diff --git a/compiler/load/tests/fixtures/build/no_deps/Principal.roc b/compiler/load_internal/tests/fixtures/build/no_deps/Principal.roc similarity index 100% rename from compiler/load/tests/fixtures/build/no_deps/Principal.roc rename to compiler/load_internal/tests/fixtures/build/no_deps/Principal.roc diff --git a/compiler/load/tests/fixtures/build/no_deps/Unit.roc b/compiler/load_internal/tests/fixtures/build/no_deps/Unit.roc similarity index 100% rename from compiler/load/tests/fixtures/build/no_deps/Unit.roc rename to compiler/load_internal/tests/fixtures/build/no_deps/Unit.roc diff --git a/compiler/load/tests/helpers/mod.rs b/compiler/load_internal/tests/helpers/mod.rs similarity index 100% rename from compiler/load/tests/helpers/mod.rs rename to compiler/load_internal/tests/helpers/mod.rs diff --git a/compiler/load/tests/test_load.rs b/compiler/load_internal/tests/test_load.rs similarity index 98% rename from compiler/load/tests/test_load.rs rename to compiler/load_internal/tests/test_load.rs index 9c3fc33182..bfe9e11612 100644 --- a/compiler/load/tests/test_load.rs +++ b/compiler/load_internal/tests/test_load.rs @@ -7,7 +7,7 @@ extern crate maplit; extern crate bumpalo; extern crate roc_collections; -extern crate roc_load; +extern crate roc_load_internal; extern crate roc_module; mod helpers; @@ -19,7 +19,7 @@ mod test_load { use roc_can::def::Declaration::*; use roc_can::def::Def; use roc_constrain::module::ExposedByModule; - use roc_load::file::LoadedModule; + use roc_load_internal::file::{load_and_typecheck, LoadedModule}; use roc_module::ident::ModuleName; use roc_module::symbol::{Interns, ModuleId}; use roc_problem::can::Problem; @@ -62,7 +62,7 @@ mod test_load { } fn multiple_modules(files: Vec<(&str, &str)>) -> Result { - use roc_load::file::LoadingProblem; + use roc_load_internal::file::LoadingProblem; let arena = Bump::new(); let arena = &arena; @@ -102,7 +102,8 @@ mod test_load { fn multiple_modules_help<'a>( arena: &'a Bump, mut files: Vec<(&str, &str)>, - ) -> Result>, std::io::Error> { + ) -> Result>, std::io::Error> + { use std::fs::{self, File}; use std::io::Write; use tempfile::tempdir; @@ -137,7 +138,7 @@ mod test_load { writeln!(file, "{}", source)?; file_handles.push(file); - roc_load::file::load_and_typecheck( + load_and_typecheck( arena, full_file_path, dir.path(), @@ -159,7 +160,7 @@ mod test_load { let src_dir = fixtures_dir().join(dir_name); let filename = src_dir.join(format!("{}.roc", module_name)); let arena = Bump::new(); - let loaded = roc_load::file::load_and_typecheck( + let loaded = load_and_typecheck( &arena, filename, src_dir.as_path(), @@ -168,7 +169,7 @@ mod test_load { ); let mut loaded_module = match loaded { Ok(x) => x, - Err(roc_load::file::LoadingProblem::FormattedReport(report)) => { + Err(roc_load_internal::file::LoadingProblem::FormattedReport(report)) => { println!("{}", report); panic!("{}", report); } @@ -323,7 +324,7 @@ mod test_load { let src_dir = fixtures_dir().join("interface_with_deps"); let filename = src_dir.join("Primary.roc"); let arena = Bump::new(); - let loaded = roc_load::file::load_and_typecheck( + let loaded = load_and_typecheck( &arena, filename, src_dir.as_path(), @@ -391,7 +392,7 @@ mod test_load { } #[test] - fn load_and_typecheck() { + fn test_load_and_typecheck() { let subs_by_module = Default::default(); let loaded_module = load_fixture("interface_with_deps", "WithBuiltins", subs_by_module); diff --git a/compiler/solve/tests/solve_expr.rs b/compiler/solve/tests/solve_expr.rs index 390479bc71..4f2cb6497f 100644 --- a/compiler/solve/tests/solve_expr.rs +++ b/compiler/solve/tests/solve_expr.rs @@ -52,7 +52,7 @@ mod solve_expr { let mut file = File::create(file_path)?; writeln!(file, "{}", module_src)?; drop(file); - let result = roc_load::file::load_and_typecheck( + let result = roc_load::load_and_typecheck( arena, full_file_path, dir.path(), @@ -67,7 +67,7 @@ mod solve_expr { let loaded = loaded.expect("failed to load module"); - use roc_load::file::LoadedModule; + use roc_load::LoadedModule; let LoadedModule { module_id: home, mut can_problems, diff --git a/compiler/test_gen/src/helpers/dev.rs b/compiler/test_gen/src/helpers/dev.rs index 2f815a53ff..bd86c0633a 100644 --- a/compiler/test_gen/src/helpers/dev.rs +++ b/compiler/test_gen/src/helpers/dev.rs @@ -47,7 +47,7 @@ pub fn helper( module_src = &temp; } - let loaded = roc_load::file::load_and_monomorphize_from_str( + let loaded = roc_load::load_and_monomorphize_from_str( arena, filename, module_src, @@ -58,7 +58,7 @@ pub fn helper( let mut loaded = loaded.expect("failed to load module"); - use roc_load::file::MonomorphizedModule; + use roc_load::MonomorphizedModule; let MonomorphizedModule { module_id, procedures, diff --git a/compiler/test_gen/src/helpers/llvm.rs b/compiler/test_gen/src/helpers/llvm.rs index 37c35d910f..f6660f977b 100644 --- a/compiler/test_gen/src/helpers/llvm.rs +++ b/compiler/test_gen/src/helpers/llvm.rs @@ -50,7 +50,7 @@ fn create_llvm_module<'a>( module_src = &temp; } - let loaded = roc_load::file::load_and_monomorphize_from_str( + let loaded = roc_load::load_and_monomorphize_from_str( arena, filename, module_src, @@ -61,14 +61,14 @@ fn create_llvm_module<'a>( let mut loaded = match loaded { Ok(x) => x, - Err(roc_load::file::LoadingProblem::FormattedReport(report)) => { + Err(roc_load::LoadingProblem::FormattedReport(report)) => { println!("{}", report); panic!(); } Err(e) => panic!("{:?}", e), }; - use roc_load::file::MonomorphizedModule; + use roc_load::MonomorphizedModule; let MonomorphizedModule { procedures, entry_point, diff --git a/compiler/test_gen/src/helpers/wasm.rs b/compiler/test_gen/src/helpers/wasm.rs index 91d195f8a0..6460cb1139 100644 --- a/compiler/test_gen/src/helpers/wasm.rs +++ b/compiler/test_gen/src/helpers/wasm.rs @@ -84,7 +84,7 @@ fn compile_roc_to_wasm_bytes<'a, T: Wasm32Result>( module_src = &temp; } - let loaded = roc_load::file::load_and_monomorphize_from_str( + let loaded = roc_load::load_and_monomorphize_from_str( arena, filename, module_src, @@ -95,7 +95,7 @@ fn compile_roc_to_wasm_bytes<'a, T: Wasm32Result>( let loaded = loaded.expect("failed to load module"); - use roc_load::file::MonomorphizedModule; + use roc_load::MonomorphizedModule; let MonomorphizedModule { module_id, procedures, diff --git a/compiler/test_mono/src/tests.rs b/compiler/test_mono/src/tests.rs index fa73ecbf61..6051e31c51 100644 --- a/compiler/test_mono/src/tests.rs +++ b/compiler/test_mono/src/tests.rs @@ -94,7 +94,7 @@ fn compiles_to_ir(test_name: &str, src: &str) { module_src = &temp; } - let loaded = roc_load::file::load_and_monomorphize_from_str( + let loaded = roc_load::load_and_monomorphize_from_str( arena, filename, module_src, @@ -105,14 +105,14 @@ fn compiles_to_ir(test_name: &str, src: &str) { let mut loaded = match loaded { Ok(x) => x, - Err(roc_load::file::LoadingProblem::FormattedReport(report)) => { + Err(roc_load::LoadingProblem::FormattedReport(report)) => { println!("{}", report); panic!(); } Err(e) => panic!("{:?}", e), }; - use roc_load::file::MonomorphizedModule; + use roc_load::MonomorphizedModule; let MonomorphizedModule { module_id: home, procedures, diff --git a/docs/src/lib.rs b/docs/src/lib.rs index 9756c8cf37..8acc05c7cc 100644 --- a/docs/src/lib.rs +++ b/docs/src/lib.rs @@ -11,7 +11,7 @@ use roc_highlight::highlight_parser::{highlight_defs, highlight_expr}; use roc_load::docs::DocEntry::DocDef; use roc_load::docs::{DocEntry, TypeAnnotation}; use roc_load::docs::{ModuleDocumentation, RecordField}; -use roc_load::file::{LoadedModule, LoadingProblem}; +use roc_load::{LoadedModule, LoadingProblem}; use roc_module::symbol::{IdentIds, Interns, ModuleId}; use roc_parse::ident::{parse_ident, Ident}; use roc_parse::state::State; @@ -418,7 +418,7 @@ pub fn load_modules_for_files(filenames: Vec) -> Vec { let mut src_dir = filename.clone(); src_dir.pop(); - match roc_load::file::load_and_typecheck( + match roc_load::load_and_typecheck( &arena, filename, src_dir.as_path(), diff --git a/editor/src/editor/mvc/ed_model.rs b/editor/src/editor/mvc/ed_model.rs index f8a3c26d7d..8c7855ee0f 100644 --- a/editor/src/editor/mvc/ed_model.rs +++ b/editor/src/editor/mvc/ed_model.rs @@ -19,7 +19,7 @@ use roc_code_markup::markup::convert::from_ast::ast_to_mark_nodes; use roc_code_markup::markup::mark_id_ast_id_map::MarkIdAstIdMap; use roc_code_markup::markup::nodes; use roc_code_markup::slow_pool::{MarkNodeId, SlowPool}; -use roc_load::file::LoadedModule; +use roc_load::LoadedModule; use roc_module::symbol::Interns; use std::path::Path; @@ -232,7 +232,7 @@ pub mod test_ed_model { use roc_ast::lang::env::Env; use roc_ast::mem_pool::pool::Pool; use roc_ast::module::load_module; - use roc_load::file::LoadedModule; + use roc_load::LoadedModule; use roc_module::symbol::IdentIds; use roc_module::symbol::ModuleIds; use roc_types::subs::VarStore; diff --git a/repl_cli/src/lib.rs b/repl_cli/src/lib.rs index 0deaeebb8d..155d3ffb81 100644 --- a/repl_cli/src/lib.rs +++ b/repl_cli/src/lib.rs @@ -13,7 +13,7 @@ use roc_build::link::module_to_dylib; use roc_collections::all::MutSet; use roc_gen_llvm::llvm::externs::add_default_roc_externs; use roc_gen_llvm::{run_jit_function, run_jit_function_dynamic_type}; -use roc_load::file::MonomorphizedModule; +use roc_load::MonomorphizedModule; use roc_mono::ir::OptLevel; use roc_parse::ast::Expr; use roc_parse::parser::{EExpr, ELambda, SyntaxError}; diff --git a/repl_eval/src/gen.rs b/repl_eval/src/gen.rs index 2c4da74d59..a5e1fa6dbd 100644 --- a/repl_eval/src/gen.rs +++ b/repl_eval/src/gen.rs @@ -4,7 +4,7 @@ use std::path::{Path, PathBuf}; use roc_fmt::annotation::Formattable; use roc_fmt::annotation::{Newlines, Parens}; -use roc_load::file::{LoadingProblem, MonomorphizedModule}; +use roc_load::{LoadingProblem, MonomorphizedModule}; use roc_parse::ast::Expr; use roc_region::all::LineInfo; use roc_reporting::report::{can_problem, mono_problem, type_problem, RocDocAllocator}; @@ -53,7 +53,7 @@ pub fn compile_to_mono<'a>( let module_src = arena.alloc(promote_expr_to_module(src)); let exposed_types = Default::default(); - let loaded = roc_load::file::load_and_monomorphize_from_str( + let loaded = roc_load::load_and_monomorphize_from_str( arena, filename, module_src, diff --git a/repl_wasm/src/repl.rs b/repl_wasm/src/repl.rs index 08cfc5965a..e72122c5a9 100644 --- a/repl_wasm/src/repl.rs +++ b/repl_wasm/src/repl.rs @@ -3,7 +3,7 @@ use std::mem::size_of; use roc_collections::all::MutSet; use roc_gen_wasm::wasm32_result; -use roc_load::file::MonomorphizedModule; +use roc_load::MonomorphizedModule; use roc_parse::ast::Expr; use roc_repl_eval::{ eval::jit_to_ast,