Fix errors

This commit is contained in:
Ayaz Hafiz 2023-10-22 09:22:38 -04:00
parent da421068f1
commit 703ef6608e
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
8 changed files with 167 additions and 20 deletions

View file

@ -90,6 +90,7 @@ pub(crate) mod diag {
match self {
Severity::RuntimeError => DiagnosticSeverity::ERROR,
Severity::Warning => DiagnosticSeverity::WARNING,
Severity::Fatal => DiagnosticSeverity::ERROR,
}
}
}
@ -130,7 +131,7 @@ pub(crate) mod diag {
LoadingProblem::UnexpectedHeader(header) => {
msg = format!("Unexpected header: {}", header);
}
LoadingProblem::MsgChannelDied => {
LoadingProblem::ChannelProblem(_) => {
msg = format!("Internal error: message channel died");
}
LoadingProblem::ErrJoiningWorkerThreads => {

View file

@ -57,7 +57,7 @@ impl Document {
}
fn line_info(&self) -> &LineInfo {
&self.line_info.as_ref().unwrap()
self.line_info.as_ref().unwrap()
}
fn module(&mut self) -> Result<&mut LoadedModule, LoadingProblem<'_>> {
@ -74,8 +74,8 @@ impl Document {
fi,
&self.source,
src_dir,
Default::default(),
roc_target::TargetInfo::default_x86_64(),
roc_load::FunctionKind::LambdaSet,
roc_reporting::report::RenderTarget::Generic,
RocCacheDir::Persistent(cache::roc_cache_dir().as_path()),
roc_reporting::report::DEFAULT_PALETTE,
@ -115,7 +115,7 @@ impl Document {
let module_path = self.url.to_file_path().unwrap();
let fmt = ProblemFmt {
alloc: &alloc,
line_info: &line_info,
line_info,
path: &module_path,
};