Skip to main content

autophagy_llvm/
error.rs

1use core::fmt;
2use std::{
3    error::Error,
4    fmt::{Display, Formatter},
5};
6
7#[derive(Debug, Eq, PartialEq)]
8pub enum LlvmError {
9    AddFn(String),
10}
11
12impl Display for LlvmError {
13    fn fmt(&self, formatter: &mut Formatter) -> fmt::Result {
14        match self {
15            Self::AddFn(name) => {
16                write!(formatter, "failed to add a function: {}", name)
17            }
18        }
19    }
20}
21
22impl Error for LlvmError {}