use std::fmt::Display;
use crate::{Error, LocatedError};
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct GeneratorInfallible;
impl Display for GeneratorInfallible {
fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
panic!("infallible generator emitted a error, please report this bug")
}
}
impl LocatedError for GeneratorInfallible {
fn location(&self) -> (usize, usize) {
panic!("infallible generator emitted a error, please report this bug")
}
}
impl<'a> From<GeneratorInfallible> for Error<'a, GeneratorInfallible> {
fn from(e: GeneratorInfallible) -> Self {
Error::Gen(e)
}
}