1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::sync::{MutexGuard, PoisonError, TryLockError};

use super::

*;

impl<T> From<PoisonError<MutexGuard<'_, T>>> for PsiError {
    fn from(error: PoisonError<MutexGuard<'_, T>>) -> Self {
        Self::runtime_error(format!("Language registry is poisoned: {}", error))
    }
}

impl<T> From<TryLockError<MutexGuard<'_, T>>> for PsiError {
    fn from(error: TryLockError<MutexGuard<'_, T>>) -> Self {
        Self::runtime_error(format!("Language registry is locked: {}", error))
    }
}