mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-22 16:30:04 +03:00
Give better error message when decrementing refcount too far
This commit is contained in:
parent
bacc645799
commit
6a416b16a0
@ -41,7 +41,8 @@ impl Storage {
|
||||
if rc_as_isize == REFCOUNT_1 {
|
||||
true
|
||||
} else {
|
||||
*rc = NonZeroIsize::new(rc_as_isize - 1).unwrap();
|
||||
*rc = NonZeroIsize::new(rc_as_isize - 1).expect("A reference count was decremented all the way to zero, which should never happen.");
|
||||
|
||||
false
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user