diff --git a/crates/compiler/solve/src/pools.rs b/crates/compiler/solve/src/pools.rs index 877ebbec79..2fae2081fe 100644 --- a/crates/compiler/solve/src/pools.rs +++ b/crates/compiler/solve/src/pools.rs @@ -1,4 +1,5 @@ use roc_types::subs::{Rank, Variable}; +use roc_error_macros::internal_error; const DEFAULT_POOLS: usize = 8; @@ -27,14 +28,14 @@ impl Pools { pub fn get_mut(&mut self, rank: Rank) -> &mut Vec { match self.0.get_mut(rank.into_usize()) { Some(reference) => reference, - None => panic!("Compiler bug: could not find pool at rank {rank}"), + None => internal_error!("Compiler bug: could not find pool at rank {rank}"), } } pub fn get(&self, rank: Rank) -> &Vec { match self.0.get(rank.into_usize()) { Some(reference) => reference, - None => panic!("Compiler bug: could not find pool at rank {rank}"), + None => internal_error!("Compiler bug: could not find pool at rank {rank}"), } } @@ -46,7 +47,7 @@ impl Pools { let last = self .0 .pop() - .unwrap_or_else(|| panic!("Attempted to split_last() on non-empty Pools")); + .unwrap_or_else(|| internal_error!("Attempted to split_last() on non-empty Pools")); (last, self.0) }