Fix panic on parse error in Package-Config.roc

This previously led to the following panic if there was a parse error in Package-Config.roc: 'There were still outstanding Arc references to module_ids', /Users/rtfeldman/code/roc/compiler/load/src/file.rs:1530:33
This commit is contained in:
Richard Feldman 2022-02-06 08:04:38 -05:00
parent 009f1b7eca
commit 7f5fc37612
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798

View file

@ -1525,13 +1525,7 @@ where
Msg::FailedToParse(problem) => { Msg::FailedToParse(problem) => {
shut_down_worker_threads!(); shut_down_worker_threads!();
let module_ids = Arc::try_unwrap(state.arc_modules) let module_ids = (*state.arc_modules).lock().clone().into_module_ids();
.unwrap_or_else(|_| {
panic!("There were still outstanding Arc references to module_ids")
})
.into_inner()
.into_module_ids();
let buf = to_parse_problem_report( let buf = to_parse_problem_report(
problem, problem,
module_ids, module_ids,