mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
Print formatted reports for roc glue
errors
This commit is contained in:
parent
946b44cfd0
commit
fcd9819118
1 changed files with 11 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
use crate::rust_glue;
|
use crate::rust_glue;
|
||||||
use crate::types::{Env, Types};
|
use crate::types::{Env, Types};
|
||||||
use bumpalo::Bump;
|
use bumpalo::Bump;
|
||||||
use roc_load::{LoadedModule, Threading};
|
use roc_load::{LoadedModule, LoadingProblem, Threading};
|
||||||
use roc_reporting::report::RenderTarget;
|
use roc_reporting::report::RenderTarget;
|
||||||
use roc_target::{Architecture, TargetInfo};
|
use roc_target::{Architecture, TargetInfo};
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
|
@ -87,7 +87,16 @@ pub fn load_types(
|
||||||
RenderTarget::Generic,
|
RenderTarget::Generic,
|
||||||
threading,
|
threading,
|
||||||
)
|
)
|
||||||
.expect("Problem loading platform module");
|
.unwrap_or_else(|problem| match problem {
|
||||||
|
LoadingProblem::FormattedReport(report) => {
|
||||||
|
eprintln!("{}", report);
|
||||||
|
|
||||||
|
process::exit(1);
|
||||||
|
}
|
||||||
|
problem => {
|
||||||
|
todo!("{:?}", problem);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
let decls = declarations_by_id.remove(&home).unwrap();
|
let decls = declarations_by_id.remove(&home).unwrap();
|
||||||
let subs = solved.inner_mut();
|
let subs = solved.inner_mut();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue