Implement missing ABI structures in StableMIR

This commit is contained in:
Celina G. Val
2024-02-29 15:23:44 -08:00
parent 6db96de66c
commit e3ac2c68b8
6 changed files with 274 additions and 26 deletions

View File

@@ -5,12 +5,14 @@
//! - [Error]: Generic error that represents the reason why a request that could not be fulfilled.
use std::fmt::{Debug, Display, Formatter};
use std::{error, fmt, io};
use std::{fmt, io};
macro_rules! error {
($fmt: literal $(,)?) => { Error(format!($fmt)) };
($fmt: literal, $($arg:tt)*) => { Error(format!($fmt, $($arg)*)) };
}
}
pub(crate) use error;
/// An error type used to represent an error that has already been reported by the compiler.
#[derive(Clone, Copy, PartialEq, Eq)]
@@ -72,8 +74,9 @@ where
}
}
impl error::Error for Error {}
impl<T> error::Error for CompilerError<T> where T: Display + Debug {}
impl std::error::Error for Error {}
impl<T> std::error::Error for CompilerError<T> where T: Display + Debug {}
impl From<io::Error> for Error {
fn from(value: io::Error) -> Self {