Fix some type mismatches

This commit is contained in:
Richard Feldman 2022-07-24 10:46:40 -04:00
parent 3765cbbc8f
commit 946b44cfd0
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798
4 changed files with 8 additions and 3 deletions

1
Cargo.lock generated
View file

@ -3444,6 +3444,7 @@ dependencies = [
"roc_error_macros", "roc_error_macros",
"roc_fmt", "roc_fmt",
"roc_gen_llvm", "roc_gen_llvm",
"roc_glue",
"roc_linker", "roc_linker",
"roc_load", "roc_load",
"roc_module", "roc_module",

View file

@ -44,6 +44,7 @@ target-all = [
roc_collections = { path = "../compiler/collections" } roc_collections = { path = "../compiler/collections" }
roc_can = { path = "../compiler/can" } roc_can = { path = "../compiler/can" }
roc_docs = { path = "../docs" } roc_docs = { path = "../docs" }
roc_glue = { path = "../glue" }
roc_parse = { path = "../compiler/parse" } roc_parse = { path = "../compiler/parse" }
roc_region = { path = "../compiler/region" } roc_region = { path = "../compiler/region" }
roc_module = { path = "../compiler/module" } roc_module = { path = "../compiler/module" }

View file

@ -7,6 +7,7 @@ use roc_cli::{
}; };
use roc_docs::generate_docs_html; use roc_docs::generate_docs_html;
use roc_error_macros::user_error; use roc_error_macros::user_error;
use roc_glue;
use roc_load::{LoadingProblem, Threading}; use roc_load::{LoadingProblem, Threading};
use std::fs::{self, FileType}; use std::fs::{self, FileType};
use std::io; use std::io;
@ -65,11 +66,11 @@ fn main() -> io::Result<()> {
} }
} }
Some((CMD_GLUE, matches)) => { Some((CMD_GLUE, matches)) => {
let input_path: &Path = matches.get_one(ROC_FILE).unwrap(); let input_path = Path::new(matches.value_of_os(ROC_FILE).unwrap());
let output_path: &Path = matches.get_one(GLUE_FILE).unwrap(); let output_path = Path::new(matches.value_of_os(GLUE_FILE).unwrap());
if Some("rs") == output_path.extension().and_then(OsStr::to_str) { if Some("rs") == output_path.extension().and_then(OsStr::to_str) {
glue::load(input_path, output_path) roc_glue::generate(input_path, output_path)
} else { } else {
eprintln!("Currently, `roc glue` only supports generating Rust glue files (with the .rs extension). In the future, the plan is to decouple `roc glue` from any particular output format, by having it accept a second .roc file which gets executed as a plugin to generate glue code for any desired language. However, this has not yet been implemented, and for now only .rs is supported."); eprintln!("Currently, `roc glue` only supports generating Rust glue files (with the .rs extension). In the future, the plan is to decouple `roc glue` from any particular output format, by having it accept a second .roc file which gets executed as a plugin to generate glue code for any desired language. However, this has not yet been implemented, and for now only .rs is supported.");

View file

@ -3,3 +3,5 @@ pub mod load;
pub mod rust_glue; pub mod rust_glue;
pub mod structs; pub mod structs;
pub mod types; pub mod types;
pub use load::generate;